Closed jahir07 closed 9 years ago
You can only do so much with live-streams. The HTML5 browsers play static media files well, but they can have problems with streams and indicating failures.
The events to use are waiting
and playing
to detect whether the media is streaming fast enough to play. EG., You click play, the play
event occurs and then (normally) shortly afterwards the playing
event will occur. However, if the stream is not fast enough, the waiting
event will occur while we wait for the media stream to connect and give us enough data to start playing, which is when the playing
event occurs.
But having said all that, every HTML5 browser is slightly different. The last I reviewed, the only one to get it correct was Safari... And Firefox. (I do not have my logbook with me since i am travelling.) Chrome would not bother with those nice events and instead have some crap way of "not generating progress events" as the only way of knowing that the stream was not actually downloading.
The error
event can be useful, and the waiting
event too if enough time passes, whereupon you can issue a restart to the live-stream, which is usually the best way to get it going again after a failure.
The MP3 stream will work the best. The Flash fallback also has the waiting and playing events implemented for MP3. Avoid AAC streams, like the plague. An AAC inside an MP4 stream can work, but Chrome tended to not like the headers and just download it. Then there is IE... And shout/icecast giving it the wrong headers... So lots of pitfalls and it not really jPlayer's fault unless we make our own browser - which is not gunna happen.
Please see tunein radio.. when click a radio to play, its show "loading" after that its turn into "connecting" then radio play and show "live".. I want just like that.. I saw jPlayer Inspector shows that value.. I want to display that value.
i want to use jplayer with full option.. like when i click to play button it should display "waiting".. then display "playing" and music will be play.. when click stop button display "stop".. if streaming server error- it should display "server error please try later" ..one of code are given below:
jQuery("#dfmr_jquery_jplayer").bind(jQuery.jPlayer.event.waiting, function(event) { jQuery("#waiting-id").text("Please = " + event.jPlayer.status.waitForLoad); });
but not work..