-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player triggers ended twice #358
Comments
Which version of contrib-ads are you using? There was an issue with double ended in 6.0.0 that was fixed in 6.0.1. |
Thats my case (using 6.0.0). I will check it with 6.0.1 and close this if it resolves that. Thank you. |
With 6.0.1 it seems even worse, because second ended event triggers earlier (together with adtimeout). I am using videojs-ima so it could be also related to videojs-ima issue. |
Do you have an example I could look at to help diagnose the issue? It would also be useful to see if you can reproduce it in the contrib-ads example integration, because if you can, that shows it is a contrib-ads issue. |
This is part of event log from player instance when content video ends:
Here is a sample page: https://games.tiscali.cz/player/vjs-testpage.html Insert this into console before play:
Btw. sample page is v6.0.0 but first ended triggers with contentended in both versions so it is probably contrib-ads issue. Second ended can be possibly wrong handled by videojs-ima. |
I could not reproduce the issue with 6.0.1 in the sample page, which would be needed for me to expect ended to work correctly, did you try it that way? |
I will. I have many components including ima plugin that change source so ofc issue can be also there. I tried to find "trigger('ended" in whole project folder without any result. So I am thinking what can cause such behavior.. :/ |
Ended is a standard media event, it happens without any code explicitly triggering it: https://developer.mozilla.org/en-US/docs/Web/Events/ended videojs-contrib-ads has a feature that tries to make sure that media events such as ended happen as expected, even with the presence of ads: https://github.com/videojs/videojs-contrib-ads/#redispatch |
Yea. I understand. The only reason why I reported it here is because it happens at exactly same time as contrib-ads contentended and adtimeout events. |
OK cool, just wanted to provide the info in case it was helpful. |
This does not explain ended when contentended, but maybe explains second one. In sample above, there is missing adstart followed by adend when postroll plays. Is that why adtimeout triggers ended? If true, I will report it to videojs-ima. |
The missing adstart / adend observation led me to understanding the issue. Adstart happens when the integration (in this case, videojs-ima) calls startLinearAdMode. This is when the ad beak begins. I noticed this in the debugger in your example page: It seems videojs-ima does not call startLinearAdMode for the postroll, so contrib-ads does not realize that an ad is playing. Notice the result of |
Ok. I've got it. That makes sense. But does this bug explain ended together with contentended? |
I'm not 100% sure, but the event redispatching relies on the player state matching what it expects, so it seems like a likely cause for this issue. handleEnded in redispatch.js checks both |
Ok. There is still chance that its my mistake, because I take care of ads.contentSrc everytime player.src() is changed (there is quality switcher and related videos). I still dont properly understand how IMA SDK handle player's video element and changing source and when create its own. On desktop its always new video elements created by SDK so I thought it wouldnt be a problem. I will check also this scenario and report it after proved. Thanks! |
Removed ads.contentSrc handling and still same so definetely ima issue. |
I tried your example and it looks correct and clear. So I am closing this issue as its probably all around ima implementation.. |
Using contrib-ads v6, player triggers ended event with contentended and then second time when postroll ends. It could break components that depends on ended event. Is this behaviour expected? I would expect that contrib-ads will throttle default ended event to end of postroll. Thanks.
The text was updated successfully, but these errors were encountered: