Streamedian / html5_rtsp_player

Play RTSP stream from IP camera in browser in this HTML5 player without plugins
Apache License 2.0
2.61k stars 598 forks source link

don't call client.reset #57

Closed mburger81 closed 7 years ago

mburger81 commented 7 years ago

I think there are many problems on starting and stoping player, one of the problems could be this all is not synchronized. You call multiple times for example this.client.reset also if IMO not needed.

For example in this case why you should call client.reset(); If there is no client it would be created before and the constructor does always call the reset() method. So you don't need to call it a second time. Same thing if lastType changed.

You have to call reset function only if lastType is equal as actual type and if the client already exists, so you can handle this with an else block