video-dev / clappr-rtmp-plugin

📺 RTMP support for Clappr player.
http://clappr.io
Apache License 2.0
105 stars 46 forks source link

Not able to play rtmp from AWS Cloudfront RTMP distribution #57

Closed danielrsgomes closed 8 years ago

danielrsgomes commented 8 years ago

I can reproduce with no problem here on the their debug player: http://d1k5ny0m6d4zlj.cloudfront.net/diag/CFStreamingDiag.html

My setup is ok, cause it works fine when playing rtmp from nginx server. I also can play the RTMP vod file from wowza flash player: https://www.wowza.com/testplayers

host: rtmp://rtmp.conanewborn.com.br:1935/cfx/st file/stream: entrada

My player setup:

Does anybody knows if that is a limitation or bug? Any tip? Thanks

gfronza commented 8 years ago

@daniel2surf

I tried to reproduce this stream URL rtmp://rtmp.conanewborn.com.br:1935/cfx/st/entrada But I'm getting StreamNotFound.

Can you provide me with another valid URL?

danielrsgomes commented 8 years ago

@gfronza I just tried again... And it is playing... Can you try again here: http://d1k5ny0m6d4zlj.cloudfront.net/diag/CFStreamingDiag.html Streaming distribution: rtmp.conanewborn.com.br Video filename: entrada Thanks

gfronza commented 8 years ago

Ok now it's working! Thanks!

gfronza commented 8 years ago

@daniel2surf I added some logging and noticed a security error when loading the URL. The streaming is not playing because of that. I'll add more debugging lines to help identify those cases.

danielrsgomes commented 8 years ago

@gfronza If the other rtmp players are able to play it, Clappr RTMP should play as well... Don't you think? Any idea how to solve it?

gfronza commented 8 years ago

@daniel2surf Yes, but so far I couldn't identify the reason for this MediaErrorEvent Connection Failed. I'll have to rebuild Adobe OSMF with logging directive enabled to have a more detailed view of the problem.

gfronza commented 8 years ago

@daniel2surf I found the issue. OSMF (a very old Adobe project) is ruling out the application instance in the path (in your case the app instance is st. Then, when trying to connect to app /cfx without specifying the instance name, the result is Connection failed.. I never noticed this because all streaming servers I worked with used the default instance (_definst_) and OSFM has a special treatment for it (rsrs).

I have a "fork" of the OSMF project and will make the fix.

danielrsgomes commented 8 years ago

@gfronza Haha... AWS Cloudfront RTMP is the first one behaving this way for me as well... Good Job! Thanks

gfronza commented 8 years ago

@daniel2surf I found out that the fix is not as simple as I first thought :( As a temporary solution, is it possible for you to use the default instance? (definst)? I'm still thinking on how I'm going to solve this without breaking anything.

danielrsgomes commented 8 years ago

@gfronza Thanks for your effort. I cannot use default instance as it is all setup by aws cloudfront distribuition... The "/cfx/st/" is their standard path... I'm using a nginx-rtmp for now... What do you think about using as parameters: host and filename. So it would be passed to the rtmp plugin and the swf player...

gfronza commented 8 years ago

@daniel2surf Adding host and filename/streamname as arguments wouldn't be a clappr-like solution. So I decided to add a boolean parameter called useAppInstance. In your case you just have to set it to true.

https://github.com/flavioribeiro/clappr-rtmp-plugin/releases/tag/0.0.14

Let me know if I can close this issue (after your validation).

danielrsgomes commented 8 years ago

@gfronza Still not able to play... Using your rtmp.min.js release... Here is the code i'm using: https://gist.github.com/daniel2surf/ed82d7da0f9ff87366f9ed10170c1969

gfronza commented 8 years ago

@daniel2surf the CDN (jsdelivr) is outdated due to the repo ownership change. We already asked them to update, but nothing so far. You'll have to host the SWF file yourself for now.

Oh, and you have to use both rtmp.min.js and the RTMP.swf from this latest release.

danielrsgomes commented 8 years ago

@gfronza Working perfect now... Thanks a lot!