googleads / videojs-ima

IMA SDK Plugin for Video.js
Apache License 2.0
445 stars 285 forks source link

VAST 402 after moving player DOM element #1102

Closed bsato212 closed 1 year ago

bsato212 commented 1 year ago

Hello videojs-ima team!

I have been using this plugin with great success for many years now. Recently, I have been tasked with making my organization's video player capable of floating and sticking to the bottom of the page. Once the video player goes out of the viewport, it should be moved to a container that follows user scrolling, allowing video playback to remain visible even after scrolling down.

However, when attempting to move around the DOM an already initialized video player I noticed that ads would not play. A video player that was initialized but not moved would play ads correctly, but after any DOM manipulation to move it around, including moving it back to its original position, ad playback would always fail with the following error:

Ad error: AdError 402: VAST media file loading reached a timeout of 8 seconds.

This are the dependencies used and their versions:

"dependencies": {
    "video.js": "7.21.4",
    "videojs-contrib-ads": "6.9.0",
    "videojs-ima": "2.1.0"
}

And here is a StackBlitz project where the issue can be easily reproduced: https://stackblitz.com/edit/vitejs-vite-a2x1ph?file=index.html

Looking at past issues I found this old one that looked similar. But since it was opened so long ago, I decided to open a new issue to verify if this was still the case: https://github.com/googleads/videojs-ima/issues/956. In short, can a video player be moved around the DOM? If not, is there any SDK method that can be called to restore ad playback capabilities?

Kiro705 commented 1 year ago

Hello @bsato212 ,

Thank you for raising this issue. Unfortunately it is still the case that the moving an IMA player around the DOM is not supported.

Feel free to reference issue #956 for their work-around.

This is actually a limitation of the IMA SDK, and not specific to the videoJS-IMA plugin. If you would like to create a feature request for this support, feel free to raise an issue on the IMA SDK technical forum.

Thank you, Jackson IMA SDK team

bsato212 commented 1 year ago

Hello @Kiro705,

I had already checked the workaround used in https://github.com/googleads/videojs-ima/issues/956 but it would not work for me as I would be be repositioning the video player mid playback. Disposing and recreating the video player would interrupt video playback which would not be desirable.

I also checked the IMA SDK technical forum and found a post there from the same author of issue #956: https://groups.google.com/g/ima-sdk/c/-jQ2WiRBUT8/m/Ms2T3jafAwAJ. Unfortunately, no solution was proposed there, just a suggestions for a possible workaround which would not be applicable to my case.

Regards, Bruno

Kiro705 commented 1 year ago

Hello @bsato212 ,

Since this is a limitation of the IMA SDK, I am going to close this issue. If you would like to request support for this behavior, please feel free to add onto the forum post you mentioned, or create a new one requesting support.

Thank you, Jackson IMA SDK team