frankyghost / projekktor

The Free Web Video Player
194 stars 75 forks source link

example to create a player to play hls on android #33

Closed alexistkd closed 10 years ago

alexistkd commented 10 years ago

Hi i would like to know if theres any doc or example file or how this player should be configured to play a stream hls

alexistkd commented 10 years ago

@fixedmachine i tried this also your example http://projekktor.wlodkowski.net/demo_hls.php but doesnt work in android 4.0+ now i configured this http://www.streaming507.com/players/tvblast/1.html works in my machine but not in android it stays loading icon

rwlodkowski commented 10 years ago

Hi @alexistkd,

it's easy. Just add an HLS item to the playlist and use proper flash fallback version.

So your config should look similar to this:

 $(document).ready(function() {
                projekktor('#player_a', {
                    playerFlashMP4: '/swf/StrobeMediaPlayback/StrobeMediaPlayback_hls.swf', // remember to use version with HLS support
                    playerFlashMP3: '/swf/StrobeMediaPlayback/StrobeMediaPlayback_hls.swf',
                    platforms: ['browser', 'ios', 'android', 'flash', 'native'],
                    playlist: [     
                        {
                        0: {src: "http://demo.unified-streaming.com/video/oceans/oceans_aes.ism/oceans_aes.m3u8", type: "application/mpegURL", streamType: "httpVideo"}, // your HLS manifest goes here
                        1: {src: "/media/intro.mp4", type: "video/mp4", streamType: "http"} // you can even add progressive fallback
                        }
                    ]    
                }
                );
            });

That's all. Should work on any device with flash 10.2+ installed or mobile device with HLS support (Android 4.1+, iOS 3+).

Live demo here: http://projekktor.wlodkowski.net/demo_hls.php

Best fixedmachine

alexistkd commented 10 years ago

@fixedmachine yes i tried that demo in android but shows loading icon

alexistkd commented 10 years ago

@fixedmachine this works http://www.streaming507.com/players/tvblast/1.html in my browser in mac but not in android running 4.4.2 galaxy s4

alexistkd commented 10 years ago

screenshot_2014-04-18-23-39-41

rwlodkowski commented 10 years ago

@alexistkd which Android version and what browser on it are you using? As I told you only Android 4.1+ are supported. Android 4.0 HLS support is buggy and we don't support it. Take a look at this: http://www.jwplayer.com/html5/hls/

I've just tested that demo on Chrome and Native Browser on Android 4.2.2 Galaxy S3 and it's working just fine. On my iPad with iOS 7.0.2 works fine too.

Best fixedmachine

alexistkd commented 10 years ago

@fixedmachine im testing with the native browser 4.4.2

alexistkd commented 10 years ago

@fixedmachine it may be buggy with my galaxy s4 too, i just test it out with my nexus 5 and works good the stream

rwlodkowski commented 10 years ago

I don't have access to any device with 4.4.2 now so I can't debug it.

Please let me know if you experiencing the same issue with the current developement version of projekktor: http://projekktor.wlodkowski.net/demo_hls_1.4.00.php

Best fixedmachine

alexistkd commented 10 years ago

@fixedmachine see that demo works perfect in my s4

rwlodkowski commented 10 years ago

Great to hear that. The next version of projekktor will be released in the next few weeks I suppose. But if you need it now you can just take the developement version from my demo site and use it.

Best fixedmachine

alexistkd commented 10 years ago

got it thank you very much

alexistkd commented 10 years ago

@fixedmachine i just forgot i can enable auto play?

i put this playerFlashMP4: 'swf/StrobeMediaPlayback/StrobeMediaPlayback_hls_mss_1.0.9-beta_debug.swf', playerFlashMP3: 'swf/StrobeMediaPlayback/StrobeMediaPlayback_hls_mss_1.0.9-beta_debug.swf', width: 640, height: 385, autoplay: true,

but doesnt autoplays

alexistkd commented 10 years ago

nevermind got it thank you so much @fixedmachine

rwlodkowski commented 10 years ago

Autoplay will not work on mobile devices only on desktops.