jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

wowza+RTMP seek not working on Chrome #264

Open gregfr opened 9 years ago

gregfr commented 9 years ago

I'm streaming a mp4 file from wowza to jPlayer via rtmp. The file plays ok from the beginning but when I seek to a different time, only the sound move, the image freezes. It works ok on Firefox. Any idea? TIA wowza 4.0.4 chrome 38 linux jplayer 2.8.3

gregfr commented 9 years ago

It works with progressive download. It look like the flash plugin doesn't refresh the image when seeing into rtmp. Is it possible to compile the flash plugin with the free compiler?

gregfr commented 9 years ago

Also if I pause then seek, it works ok

thepag commented 9 years ago

Hello @gregfr I do not know what the problem is with wowza and the RTMP player in the jPlayer flash. I did not write that part, @rmhall generously donated the entire RTMP player. If you ask me, it is all the nonsense we have to do in the RTMP player to make it behave like the HTML5 element that may be causing the problem. All the players are like that though. Little things like to change position in the flash you play from the point and immediately stop. (Or something like that - it has been a while since being intimate with that code.)

As for changing the Actionscript code and recompiling, it is now very easy, assuming you have node installed on your computer. And assuming you have git installed on the command line.

That will use the adobe flex 4.6 compiler.

Otherwise, just run flex from your own copy of the files to compile it. That was what I used to do.

thepag commented 9 years ago

Apparently I need to update my docs on that bit: jPlayer-files-plugin

But there are links to the flex sdk if you want to go that way.

I'd suggest installing git and node. There is a git app to ease matters, but I favour the command line. You can then clone the repo, then make a local branch and start making your changes. That way you can keep your branch up to date with jPlayer, and if you want to you could contribute your solution back to us with a pull request.

gregfr commented 9 years ago

Thanks for your answer. I compiled locally and it was indeed quite easy. Now I have to learn actionscript ;) Can you try this url? rtmp://live.civideo.fr:1935/vod/mp4:sample.mp4 I will try with other players, the fact that it works in firefox and not chrome makes me thing it may be related to the google version of flash shipped with chrome.

gregfr commented 9 years ago

OK I just tested with mediaelement on the same html page with the same rtmp url and it's working, so it's indeed specific to jplayer...

xysm42 commented 9 years ago

ran into the same issue, here is a quick hack to fix it.

edit JplayerRtmp.as, inside the play() function look for SEEKER3 and adjust to the following:

if(!isNaN(time)) { // Avoid using seek() when it is already correct.
    trace("SEEKER3");
    myStream.addEventListener(NetStatusEvent.NET_STATUS,customSeekHandler);
    pause();
    function customSeekHandler(event:NetStatusEvent):void 
    { 
        if (event.info.code == "NetStream.Pause.Notify")
        {
            myStream.removeEventListener(NetStatusEvent.NET_STATUS,customSeekHandler);
            myStream.seek(myStatus.pausePosition/1000);
        }
    }
}

recompile the swf and you are good to go. i added the listener because if a user tried to seek rapidly weird things would happen.