Magics-Group / wcjs-renderer

Renderer JS API for WebChimera.js
http://webchimera.org/
MIT License
40 stars 24 forks source link

Video stops playing #5

Closed MikeGCV closed 9 years ago

MikeGCV commented 9 years ago

Hello, with the example provided, the video stop's playing after some time. With wcjs-player, this doesn't happen

RSATom commented 9 years ago

What exactly example?

jaruba commented 9 years ago

Yup, if you leave a video paused for a long time, some servers time out and disconnect you. Such is the case with videos from archive.org as the one in the example.

WebChimera.js Player has measures set in place to reconnect if such a case is detected.

jaruba commented 9 years ago

This is the code from wcjs-player that handles the reconnecting:

https://github.com/jaruba/wcjs-player/blob/master/index.js#L1388-L1391

MikeGCV commented 9 years ago

With this example:

var wcjs = require("wcjs-renderer"); var player = wcjs.init(document.getElementById("canvas")); player.play("http://archive.org/download/CartoonClassics/Krazy_Kat_-_Keeping_Up_With_Krazy.mp4");

Sometimes in the middle of the reproduction, the "onEndReached" event is emited and the reproduction stops, In wcjs-player it's also happening. With offline files everything works great, it's just the online files (I've tried with other servers, same thing). Don't know if it's a caching or buffer problem. Will try on linux tomorow.

jaruba commented 9 years ago

Don't know if it's a caching or buffer problem. Will try on linux tomorow.

It's either the server your streaming from disconnecting you (as mentioned above), or you might be experiencing some network issues, either the router, ISP or network card is dropping the internet periodically for a while then bringing it back up.

I guess in both situations you can say it's a buffer problem..

jaruba commented 9 years ago

To test if you have network issues and are on a windows box, you can just run ping -t archive.org and check if anything is strange with the pings when the player stops.

MikeGCV commented 9 years ago

I've been playing with the buffering and caching values, it seems to work ok now, thank you for your help

jaruba commented 9 years ago

Interesting, default buffer is 10000 (10 seconds), which should normally be more then enough.

Also, --network-cache in vlcArgs is the same as the buffer parameter (in wcjs-player). :)

I'm still betting on the cause of this being an internal network issue though.