Developer API » Flash Stream API
Description
A html tag for flash live player to be embedded in the browser. You can also receive and control the status of the flash player via JavaScript.
HTML Code
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="320" height="198" id="livestreamer" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="user=twitcastest&lang=en&mute=0&cupdate=0&offline=" /><param name="movie" value="http://twitcasting.tv/swf/livestreamer2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="http://twitcasting.tv/swf/livestreamer2.swf" quality="high" bgcolor="#ffffff" width="320" height="198" name="livestreamer" id="livestreamderembed" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" flashVars="user=twitcastest&lang=en&mute=0&cupdate=0&offline=" ></object>
Requirements
Flash 10 Player (PC, Android 2.2)
Authentication
None
Limitation
Not applicable for the password-protected lives.
Flash Parameters
| user |
A user id to show live.
ライブを表示する対象のuser id |
|---|---|
| width, height |
width and height of the Flash Player. Set 16:9 aspect ratio to erase the bottom control bar.
Otherwise, set aspect ratio to 320:198.
Flashプレイヤーの横幅と高さを指定します。画面下部のコントロールバーを消去するには16:9の比率で数値を指定してください。逆にコントロールバーを表示する場合は 320:198 の比率で指定します。 |
| lang (optional) |
Set language of the live player. Default is en.
Flashプレイヤーの表示言語を指定します。デフォルトはenです。 |
| mute (optional) |
Set this value to 1 if you want to start live player with mute mode.
Flashプレイヤーをミュート状態でスタートさせる場合、この値を1に設定します。 |
| cupdate (optional) |
Set this value to 1 if you want to receive comment update event.
新しいコメントが投稿されたことの通知イベントを受け取る場合は1を指定します。 |
| offline (optional) |
Set this value to your desired image url if you want to show a specific image when the live is offline. Note that the image is scaled to fit in the 16:9 aspect with top aligned.
オフラインの場合に表示する画像を URL で指定することができます。この画像は16:9の比率になっていることが望ましいです。 |
JavaScript Events
You will receive JavaScript events from the embedded live player.
Flashプレイヤーの状態の変化をJavaScriptで受信できます。
function TwitCastingLiveEventReceived(userid, movieid, type, value)
| type | value |
|---|---|
| onlive |
Called when live starts.
ライブが開始されたときに通知されます。 |
| offline |
Called when live is offline.
ライブが終了したときに通知されます。 |
| mute |
1 if mute is turned on, 0 if mute is turned off.
ミュートになると1、ミュートが解除されると0が通知されます。 |
| viewer |
Number of viewers for this live.
同時閲覧者数が変更されたときに通知されます。 |
| total |
Total number of viewers for this live.
トータル閲覧者数が変更されたときに通知されます。 |
| typing |
A screen name of the user who is start typing the comment.
コメントの書き込みが開始されたときに、書き込みユーザーの表示名が通知されます。 |
| hashtag |
A hash tag string. Note that this value can be null string if hash tag is removed.
ハッシュタグが設定されたときに通知されます。ハッシュタグが解除されたときには空文字が通知されます。 |
| subtitle |
A subtitle string. Note that this value can be null string if subtitle is removed.
テロップが設定されたときに通知されます。テロップが解除されたときにはから文字が通知されます。 |
JavaScript Controls
You can control the properties of the live player.
Flashプレイヤーのコントロールを外部から操作できます。
| function | description |
|---|---|
| setVolume(value) |
Set volume to the specified value. A value should be in the range of 0 - 100.
ボリュームを調整します。0-100の値を指定できます。 |
| setMute(value) |
True if you want to switch to mute mode, false if unmute mode.
trueにするとミュートになります。falseでミュートが解除されます。 |
Sample
| Volume | |
|---|---|
| Mute |
