Skip to content

Add multi audio API #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions _posts/2015-09-01-player.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,16 @@ <h4>cc (closed caption)</h4>
<h6>Example</h6>
<pre><code class="javascript">viewer.callMethod('cc', 1); //enable the closed caption with index 1</code>
<code class="javascript">viewer.callMethod('cc', -1); //disables the closed caption</code></pre>


<h4>multi audio</h4>
<p>Sets the audio language of the stream. Requires one argument:</p>
<ul>
<li>an <code>audioIndex</code> key from the received audio tracks array in <code>audio</code> event</li>
</ul>

<h6>Example</h6>
<pre><code class="javascript">viewer.callMethod('audio', 1); //select audio track with index 1</code></pre>

<h3>getProperty</h3>
<p>Read a property of the embed player. This method is <strong>asynchronous</strong>, the data will be passed to a callback function, given as argument.<br/></p>
<p>Accessible properties by <code>getProperty</code>:</p>
Expand Down Expand Up @@ -308,7 +317,26 @@ <h6>Example</h6>
[
{"index":0, "label":"English", "language":"en", "active":false}
]</code></pre>


<h4>multi audio</h4>
<p>Fired when there are multiple audio tracks.</p>
<p>Returns an array containing audio tracks as objects.</p>
<ul>
<li><code>index</code> (integer) unique index of the audio track</li>
<li><code>label</code> (string) label of the audio</li>
<li><code>language</code> (string) language code of the audio</li>
<li><code>country</code> (string) country code of the audio</li>
<li><code>active</code> (booelan)</li>
</ul>

<h6>Example</h6>
<pre><code class="javascript">viewer.addListener('audio', callBack);</code></pre>
<pre><code class="javascript">// example audio object
[
{ "index": 0, "label": "English (US)", "language": "en", "country": "US", "active": true },
{ "index": 1, "label": "French", "language": "fr", "country": "00", "active": false }
]</code></pre>

<h4>content</h4>
<p>Called when a the player content changes for some reason. Same data as received in <code>getProperty('content')</code></p>
<p>Received arguments: <code>data</code> (object)</p>
Expand Down