videojs / videojs-contrib-ads

A Tool for Building Video.js Ad Plugins
http://videojs.github.io/videojs-contrib-ads/
Other
381 stars 257 forks source link

Live Dash stream race condition issue #446

Open rhodh opened 5 years ago

rhodh commented 5 years ago

Description

When loading live dash stream with autoplay we can get a race condition where paused is called before play request is complete.

Steps to Reproduce

Expected Results

We don't get a "Caught pending play exception" every time we zap and the stream doesn't hang.

Actual Results

Stream hangs after continuous zapping and we get a "Caught pending play exception" every time we zap.

Workaround

In cancelContentPlay() before pausing the player I added

while(video.seeking()) { }

This did fix the issue. But maybe this isn't the correct way to go about resolving the issue. But if it is I'm happy to create a PR for it.

Versions

videojs-contrib-ads version: 6.4.1

Video-js version: 7.2

videojs-ima version: 1.5.1

Platforms

Browsers: Chrome v69

OS/Devices: Windows 10

mysuf commented 5 years ago

Also It misses first loadstart and then, for whatever reason, triggers readyforpreroll twice while adsready was triggered once.

incompl commented 5 years ago

Can this issue be reproduced in the example integration? It is difficult to debug this without a reduced test case, or know which project the issue lies within.

mysuf commented 5 years ago

@incompl I tried it in both videojs-ima (reported above) and also mine integration with same behaviour. I didnt try contrib-ads-example. I guess that it will be related to missing loadstart event which breaks (somehow) contrib-ads internal workflow.