Commit 21dc1443 authored by Dan Rossi's avatar Dan Rossi
Browse files

- #99 add isDefault bitrate config option to f4m

- #99 change domain parsing to native function instead of mx classes.
parent 653c14aa
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<script type="text/javascript" src="flowplayer-3.0.5.min.js"></script>-->
<script src="../flowplayer-3.2.6.min.js"></script>
<script src="flowplayer-3.2.12.js"></script>
<!-- page title -->
......@@ -15,10 +15,12 @@
style="display:block;width:440px;height:247px"
id="player">
</a>
<script>
flowplayer("player", "../build/flowplayer-3.2.8-dev.swf",
flowplayer("player", "../../../flash-build/build/flowplayer.swf",
{
log: { level: 'debug', filter: 'org.flowplayer.bwcheck.*' },
log: { level: 'debug', filter: 'org.flowplayer.cluster.*, org.flowplayer.f4m.*, org.flowplayer.httpstreaming.*, org.flowplayer.bwcheck.*' },
onStart: function() {
console.log("onStart");
},
......@@ -36,10 +38,22 @@
},
clip: {
//url: "http://itv08.digizuite.dk/tv2b/ngrp:ch1_all/manifest.f4m",
//url: "http://localhost:1935/live/livestream/manifest.f4m",
url: "sample1.f4m",
//url: "http://localhost:1935/dvr/livestream/manifest.f4m?DVR",
//urlResolvers: ['f4m'],
urlResolvers: ['f4m','bwcheck'],
provider: 'httpstreaming',
baseUrl: "http://httpstreaming.electroteque.org/videos/vod/"
startLivePosition: true,
baseUrl: 'http://stream.flowplayer.org/httpstreaming/',
bitrates: [
{ bitrate: 259},
{ bitrate: 405, isDefault: true},
{ bitrate: 894},
{ bitrate: 3064}
]
},
plugins: {
......@@ -57,10 +71,13 @@
url: 'flowplayer.httpstreaming.swf'
},
bwcheck: {
url: 'flowplayer.bwcheck.swf',
netConnectionUrl: 'http://flowplayer.electroteque.org/swf/flowplayer-bwcheck.swf',
url: 'flowplayer.bwcheck-httpstreaming.swf',
//netConnectionUrl: 'http://flowplayer.electroteque.org/swf/flowplayer-bwcheck.swf',
dynamicBuffer: true,
netConnectionUrl: "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf",
bitrateProfileName: 'HTTPBitrateProfile',
dynamic: false,
dynamic: true,
checkOnStart: true,
//onStreamSwitch: switchStreamInfo,
//onStreamSwitchBegin: switchStreamInfoBegin,
// this method is called when the bandwidth check is done
......@@ -71,13 +88,16 @@
onStreamSwitchBegin: function (newItem, currentItem) {
console.log("Will switch to: " + newItem.streamName +
" from " + currentItem.streamName);
// $f().getPlugin('content').setHtml("Will switch to: " + newItem.streamName +
// " from " + currentItem.streamName);
$f("player").getPlugin('content').setHtml("Will switch to: " + newItem.bitrate +
" from " + currentItem.bitrate);
},
onStreamSwitch: function (newItem) {
console.log('content').setHtml("Switched to: " + newItem.streamName);
// $f().getPlugin('content').setHtml("Switched to: " + newItem.streamName);
}
// console.log('content').setHtml("Switched to: " + newItem.streamName);
$f("player").getPlugin('content').setHtml("Switched to: " + newItem.bitrate);
},
onBwDone: function(mappedBitrate) {
$f("player").getPlugin('content').setHtml("Mapped to: " + mappedBitrate.bitrate);
}
},
content: {
url: 'flowplayer.content.swf',
......
Version history:
3.2.9
-----
- #99 cleanup domain parsing, use native function instead of mx classes.
3.2.4
-----
- #601 dispatch resolver failure correctly.
......
......@@ -162,8 +162,14 @@ package org.flowplayer.cluster
private function _getFailedServerSO(host:String):SharedObject
{
var domain:String = URLUtil.baseUrl(host);
return SharedObject.getLocal(domain,"/");
return SharedObject.getLocal(getDomain(host),"/");
}
private function getDomain(url:String):String {
var schemeEnd:int = url.indexOf("//") + 2;
var domain:String = url.substr(schemeEnd);
var endPos:int = domain.indexOf("/");
return domain.substr(0, endPos);
}
public function setFailedServer(host:String):void
......
......@@ -2,6 +2,7 @@
------
- New code requires to be compiled against OSMF 2.0
- fixes for osmf dateutil class
- #99 add isDefault bitrate config option
3.2.9
-----
......
......@@ -154,6 +154,7 @@ package org.flowplayer.f4m {
if (itemConfig.hasOwnProperty("label")) bitrateItem.label = itemConfig.label;
if (itemConfig.hasOwnProperty("sd")) bitrateItem.sd = itemConfig.sd;
if (itemConfig.hasOwnProperty("hd")) bitrateItem.hd = itemConfig.hd;
if (itemConfig.hasOwnProperty("isDefault")) bitrateItem.isDefault = itemConfig.isDefault as Boolean;
}
bitrateItems.push(bitrateItem);
......@@ -197,13 +198,20 @@ package org.flowplayer.f4m {
{
log.debug("F4M Manifest Finished");
try
{
//#493 add option to include application instance for rtmp base urls.
if (!manifest.urlIncludesFMSApplicationInstance && manifest.baseURL)
manifest.urlIncludesFMSApplicationInstance = _config.includeApplicationInstance;
netResource = parser.createResource(manifest, new URLResource(_clip.completeUrl));
try
{
netResource = parser.createResource(manifest, new URLResource(_clip.completeUrl));
}
catch (error:Error)
{
handleStreamNotFound(error.message);
return;
}
if (netResource is DynamicStreamingResource) {
dynResource = netResource as DynamicStreamingResource;
......@@ -236,11 +244,7 @@ package org.flowplayer.f4m {
_successListener(_clip);
}
}
catch (error:Error)
{
handleStreamNotFound(error.message);
}
}
/**
......
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