Commit e6fa454f authored by Dan Rossi's avatar Dan Rossi
Browse files

- updates to mbr switching support for the hls plugin

parent dfca3a53
......@@ -181,8 +181,29 @@ flowplayer("bitrate", "@PLAYER_SWF@", {
},
brselect: {
url: "flowplayer.bitrateselect.swf",
menu: true
}
menu: true,
onStreamSwitchBegin: function (newItem, currentItem) {
$f("bitrate").getPlugin('content').setHtml("Will switch to: " + newItem.streamName +
" from " + currentItem.streamName);
},
onStreamSwitch: function (newItem) {
$f("bitrate").getPlugin('content').setHtml("Switched to: " + newItem.streamName + " with bitrate: " + newItem.bitrate);
}
},
content: {
url: 'flowplayer.content.swf',
bottom: 30, left: 0, width: 250, height: 150,
backgroundColor: 'transparent', backgroundGradient: 'none', border: 0,
textDecoration: 'outline',
style: {
body: {
fontSize: 14,
fontFamily: 'Arial',
textAlign: 'center',
color: '#ffffff'
}
}
}
},
......@@ -195,7 +216,7 @@ flowplayer("bitrate", "@PLAYER_SWF@", {
autoPlay: false,
bitrates: {
labels: { "300": "Low", "400": "Medium", "600": "High" },
default: 600
default: 400
},
},
log: {
......@@ -232,7 +253,28 @@ flowplayer("player", "@PLAYER_SWF@", {
},
brselect: {
url: "flowplayer.bitrateselect.swf",
menu: true
menu: true,
onStreamSwitchBegin: function (newItem, currentItem) {
$f("bitrate").getPlugin('content').setHtml("Will switch to: " + newItem.streamName +
" from " + currentItem.streamName);
},
onStreamSwitch: function (newItem) {
$f("bitrate").getPlugin('content').setHtml("Switched to: " + newItem.streamName + " with bitrate: " + newItem.bitrate);
}
},
content: {
url: 'flowplayer.content.swf',
bottom: 30, left: 0, width: 250, height: 150,
backgroundColor: 'transparent', backgroundGradient: 'none', border: 0,
textDecoration: 'outline',
style: {
body: {
fontSize: 14,
fontFamily: 'Arial',
textAlign: 'center',
color: '#ffffff'
}
}
}
},
......@@ -246,7 +288,7 @@ flowplayer("player", "@PLAYER_SWF@", {
autoPlay: false,
bitrates: {
labels: { "300": "Low", "400": "Medium", "600": "High" },
default: 600
default: 400
},
},
log: {
......
......@@ -104,6 +104,8 @@ package org.electroteque.m3u8 {
*/
override protected function doLoad(event:ClipEvent, netStream:NetStream, clip:Clip):void {
if (!netResource) return;
clip.onPlayStatus(onPlayStatus);
_bufferStart = clip.currentTime;
_startSeekDone = false;
netStream.play(clip.url, clip.start);
......@@ -377,6 +379,29 @@ package org.electroteque.m3u8 {
return true;
}
protected function onPlayStatus(event:ClipEvent) : void {
log.debug("onPlayStatus() -- " + event.info.code);
if (event.info.code == "NetStream.Play.TransitionComplete"){
dispatchEvent(new ClipEvent(ClipEventType.SWITCH_COMPLETE));
}
return;
}
/**
* Setup switch events on the netstream
* @param event
*/
override protected function onNetStatus(event:NetStatusEvent) : void {
log.debug("onNetStatus(), code: " + event.info.code + ", paused? " + paused + ", seeking? " + seeking);
switch(event.info.code){
case "NetStream.Play.Transition":
log.debug("Stream Transition -- " + event.info.details);
dispatchEvent(new ClipEvent(ClipEventType.SWITCH, event.info.details));
break;
}
return;
}
/**
* @inherit
* @param event
......@@ -481,14 +506,6 @@ package org.electroteque.m3u8 {
return true;
}
/**
* @inherit
* @param event
*/
override protected function onNetStatus(event:NetStatusEvent):void {
log.info("onNetStatus: " + event.info.code);
}
public function getDefaultConfig():Object {
return null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment