Skip to content

Commit

Permalink
flashlsFlowplayer: support JS URL Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
mangui committed Apr 13, 2015
1 parent cae2daa commit 1d810b1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
20 changes: 19 additions & 1 deletion examples/flowplayer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

<script type="text/javascript" src="flowplayer-3.2.12.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript" src="../libs/JSLoaderFragment.js"></script>
<script type="text/javascript" src="../libs/JSLoaderPlaylist.js"></script>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand All @@ -14,6 +15,23 @@
ga('create', 'UA-52843650-1', 'auto');
ga('send', 'pageview');

function getFlashMovieObject(movieName)
{
if (window.document[movieName])
{
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1)
{
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
{
return document.getElementById(movieName);
}
}

</script>

</head>
Expand Down
11 changes: 10 additions & 1 deletion src/org/mangui/flowplayer/HLSStreamProvider.as
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ package org.mangui.flowplayer {
import org.mangui.hls.constant.HLSPlayStates;
import org.mangui.hls.event.HLSEvent;
import org.mangui.hls.HLS;
import org.mangui.hls.utils.JSURLLoader;
import org.mangui.hls.utils.JSURLStream;
import org.mangui.hls.utils.Params2Settings;

CONFIG::LOGGING {
Expand Down Expand Up @@ -78,7 +80,14 @@ package org.mangui.flowplayer {
for (var object : String in cfg) {
var subidx : int = object.indexOf("hls_");
if (subidx != -1) {
Params2Settings.set(object.substr(4), cfg[object]);
if(object.indexOf("jsloader")!=-1) {
if(cfg[object] == true) {
_hls.URLstream = JSURLStream as Class;
_hls.URLloader = JSURLLoader as Class;
}
} else {
Params2Settings.set(object.substr(4), cfg[object]);
}
}
}

Expand Down

0 comments on commit 1d810b1

Please sign in to comment.