Every time I have to work with the beautiful JW Player I discover a new interesting feature. Have you ever had disconnection problems when using it with online streaming service?
Personally I had many! I used it for a web radio streaming service on RDS.IT and I had to solve the continuous disconnections from the stream that usually stop the playing.
So JW Player helps us with a very nice Events managing that can be used within a trick:
when an ONTIME POSITION is undefined (typically when a streaming connection breaks up) we can fire a reconnection method.
Let’s see how:
The trick is the following one: after an undefined onTime event (that fires if client disconnected to the stream) I clear all the previous time intervals, stop the player and set up a new interval that fires a new play attempt every 5 seconds (or whatever). When a successful onPlay event is fired I clear the time interval so not to have any other connection try.
That’s all. Hope it can help.