mangui / flashls

HLS Flash Plugin/Player (Chromeless,OSMF,FlowPlayer,mediaelement.js,video.js,Clappr)
http://www.flashls.org
Mozilla Public License 2.0
751 stars 264 forks source link

Cannot get hls to work #37

Closed barryallott closed 9 years ago

barryallott commented 10 years ago

Hello.

Im using the js from the flowplayer example (for flowplayer), also ttp://releases.flowplayer.org/swf/flowplayer-3.2.12.swf for the flowplayer swf. then i have the following code

flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.12.swf", { // configure the required plugins wmode: 'direct', plugins: { httpstreaming: { url: 'http://boxlistsdev.com/boxlists/scripts/flowplayer/flashlsFlowPlayer.swf', hls_debug: true, hls_debug2: true, hls_lowbufferlength: 3, hls_minbufferlength: 8, hls_maxbufferlength: 60, hls_startfromlowestlevel: false, hls_seekfromlowestlevel: false, hls_live_flushurlcache: false, hls_seekmode: 'ACCURATE', hls_capleveltostage: false, hls_maxlevelcappingmode: 'downscale' } }, clip: { accelerated: true, url: Url, //url: "http://boxlistsdev.com/boxlists/content/music/master.m3u8", urlResolvers: ["httpstreaming", "brselect"], provider: "httpstreaming", autoPlay: true } }); }

The URL points to a m3u8 file which contains

EXTM3U

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=125000,CODECS="mp4a.40.2"

https://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/index_0_a.m3u8?null=&id=AgCX4LhXWt%2fYJgHt5VP%2fdx1ezv+e18GoFB%2f6y35WgLvpr+5yVqnPQxKVW5ZvHIbYzg89QTLNziJY5Q%3d%3d&hdntl=exp=1407663745~acl=%2fi%2f132%2f750%2f079%2f155%2faudio.mp4*~data=hdntl~hmac=0082a22557fd8cd00eba9c76c6eab4a92cf1013dd2da89283fedb6b3b5931098

as you see there is another m3u8 file which is

EXTM3U

EXT-X-TARGETDURATION:10

EXT-X-ALLOW-CACHE:YES

EXT-X-KEY:METHOD=AES-128,URI="https://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/crypt.key?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669"

EXT-X-VERSION:2

EXT-X-MEDIA-SEQUENCE:1

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment1_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment2_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment3_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment4_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment5_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment6_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment7_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment8_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment9_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment10_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment11_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment12_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment13_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment14_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment15_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment16_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment17_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:10,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment18_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXTINF:9,

http://webstream-vh.akamaihd.net/i/132/750/079/155/audio.mp4/segment19_0_a.ts?null=&id=AgCX4LhXWt%2fYJJPV5VMUV8HghDyfCj6Tnr3YGI9n33WHh8fim1VPkGenbb2bSJa7FHqowD%2faD4PDZQ%3d%3d&hdntl=exp=1407657747~acl=/i/132/750/079/155/audio.mp4*~data=hdntl~hmac=67bf470953d01f0177ef7fa852fc314b6f86a055d83731be23f753015e17c669

EXT-X-ENDLIST

From developer tools of chrome, I can see that the swfs are loaded in and something is requesting the cross domain from both sides, but then nothing..!

Any help please.

barryallott commented 10 years ago

Here is the cross domain from the other domain if you need it

<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> cross-domain-policy><allow-http-request-headers-from domain="" headers="" /cross-domain-policy

Sorry, this does have proper xml but the comment hides it

barryallott commented 10 years ago

Also all tried hosting the first m3u8 file locally and reference that. What I saw in the Chrome network log is that the m3u8 file is retreived but then again,, nothing...

barryallott commented 10 years ago

I also found this on another site:

Hi Ian i am the developer of the plugin. This is usual responses from you guys I'm afraid and its much deeper than just the player. The issue is your system uses akamai which you redirect to. Flash cannot handle redirected urls to obtain the real url for generating the base url from so a redirect proxy is required to handle that. On top of that the akamai urls use session cookies. If third party cookies or cookies is blocked completely it will fail to work because when loading the urls via flash the cookie does not get added, if third party cookies are enabled the cookie will get added. In research people building mobile apps have similar issues with the akamai HLS streams. I have someone who is a pro customer trying to use this for flash I hope that is ok, however this cookie issue has been a problem. If you may is there a way to generate the auth tokens when requesting the urls ? There is zero documentation anywhere about this.

So it might be due to the host and flash redirects?

mangui commented 10 years ago

Hi I would need debug logs from JS console to help u

barryallott commented 10 years ago

I've set flowplayer to debug as well as the flash var. I get

$f.fireEvent ["onBeforeLoad"] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onLoad", "httpstreaming", null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onLoad", "controls", null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onLoad", "player", null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onBeforeBegin", 0, Object, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onStageVideoStateChange", 0, null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onBegin", 0, Object, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onLoad", "play", null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onBeforePluginEvent", "controls", "onBeforeHidden", null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onResized", 0, null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onPluginEvent", "controls", "onHidden", null, null, null] flowplayer-3.2.12.min.js:24

For remote m3u8 and

$f.fireEvent ["onBeforeLoad"] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onLoad", "httpstreaming", null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onLoad", "controls", null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onLoad", "player", null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onBeforeBegin", 0, Object, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onStageVideoStateChange", 0, null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onBegin", 0, Object, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onLoad", "play", null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onBeforePluginEvent", "controls", "onBeforeHidden", null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onResized", 0, null, null, null, null] flowplayer-3.2.12.min.js:24 $f.fireEvent ["onPluginEvent", "controls", "onHidden", null, null, null] flowplayer-3.2.12.min.js:24

When the initial m3u8 is hosted locally

Code I used to init the player

flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.12.swf", { // configure the required plugins live: true, debug: true, wmode: 'direct', plugins: { httpstreaming: { url: 'http://boxlistsdev.com/boxlists/scripts/flowplayer/flashlsFlowPlayer.swf', hls_debug: true, hls_debug2: true } }, clip: { accelerated: true, //url: Url, url: "local/master.m3u8", urlResolvers: ["httpstreaming", "brselect"], provider: "httpstreaming", autoPlay: true } });

mangui commented 10 years ago

Hi @barryallott I dont see any flashls debug logs below (just flowplayer ones). could you first ensure your stream is playing as expected with chromeless player ?

check it on the following page : www.flashls.org/latest/examples/chromeless enable debug/debug2 traces, and then load your URL, and hit play. if it is not working plz share JS console logs. Cheers, Mangui

barryallott commented 10 years ago

[20:23:4] load URL https://webstream-vh.akamaihd.net/i/007/067/667/155/audio.mp4/master.m3u8?r…mp4*~hmac=6bba6b12544365b3db3c8002a67fcbf0af1d6d8fc99302bfcb0e01fb90e143b5 (index):202 ERROR:HLSError(code/url/msg)=1/https://webstream-vh.akamaihd.net/i/007/067/667/155/audio.mp4/master.m3u8?r…ac=6bba6b12544365b3db3c8002a67fcbf0af1d6d8fc99302bfcb0e01fb90e143b5/Cannot load M3U8: crossdomain access denied:Error #2048 VM92:1 INFO:HLSNetStream:close VM93:1 [20:23:4] onError():error code:1 url:https://webstream-vh.akamaihd.net/i/007/067/667/155/audio.mp4/master.m3u8?r…mp4*~hmac=6bba6b12544365b3db3c8002a67fcbf0af1d6d8fc99302bfcb0e01fb90e143b5 message:Cannot load M3U8: crossdomain access denied:Error #2048

Logs from that player.. I checked and I could get at the file through chrome browser but not the player

mangui commented 10 years ago

there is a permission issue : it looks like your crossdomain.xml is not set correctly. refer to http://kb2.adobe.com/cps/142/tn_14213.html

barryallott commented 10 years ago

Hmmm... From the link you sent an example cross domain is <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> cross-domain-policy> allow-access-from domain="www.company.com" /> /cross-domain-policy>

And I can see the crossdomain.xml located at https://webstream-vh.akamaihd.net/crossdomain.xml

<?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> cross-domain-policy> allow-access-from domain=""/> (there is a * between the quotes - message board is hiding it) allow-http-request-headers-from domain="" headers=""/> (there is a \ between the quotes - message board is hiding it) /cross-domain-policy>

note: again - had to remove the leading < or the text was removed

It looks ok to me and I cannot change this anyway.

mangui commented 10 years ago

yes, it looks correct at a first sight, but this error is returned by Flash Player, so definitely there should be something wrong around the cross domain policy. basically this error is returned when flashls does a simple URL load on the playlist ...

scan commented 10 years ago

I encountered a similar problem with the plugin in the Grind player. It might not be related, but I could fix it by adding secure="false" to the crossdomain.xml, like so:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <allow-access-from domain="*" secure="false" />
    <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
</cross-domain-policy>

But the reason in my case was that my .m3u8 was served over HTTPS, while the plugin was locally loaded via HTTP.