Skip to content
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

Reloading videojs-ima plugin #1139

Open
tommarulak-playinc opened this issue May 2, 2024 · 3 comments
Open

Reloading videojs-ima plugin #1139

tommarulak-playinc opened this issue May 2, 2024 · 3 comments
Assignees

Comments

@tommarulak-playinc
Copy link

Hello,

I'm curious if there's a way for videojs-ima plugin to reset itself, effectively ready to be reinitialised?

The scenario is this: we aim to utilize a single player and relocate it within a carousel for smooth scrolling transitions. After the carousel scroll ends, we relocate the player to the active slide and switch the source. However, we can't dispose and recreate the player because, with sound enabled, the video won't autoplay on the third slide on mobile (the browser interprets this as lacking direct user interaction with the video, thus disabling autoplay with sound). Currently, our preroll fails to play on the second slide if we relocate the player in the DOM. It seems the ima SDK lacks support for scenarios where the player is moved within the DOM. So we just wonder if there is a way to reinitialise the videojs-ima after we move the player? Hopefully this will play the ads and autoplay is still working with sound on when user scroll around.

Kind regards..

@Nonchalantcode
Copy link

Hi @tommarulak-playinc !

Following this thread in case you get an asnwer. I had actually raised the same issue you're raising here unknowingly:

#1140

@Kiro705
Copy link
Member

Kiro705 commented May 8, 2024

Hello @tommarulak-playinc ,

I do not think this plugin supports the case of reloading itself. I would recommend using the IMA H5 SDK without the videoJS plugin, which will allow more customization in your implementation.

If you can identify the specific functionality that needs to be supported by the plugin for your use-case, I can look into updating it in the next version.

Thank you,
Jackson
IMA SDK team

@tommarulak-playinc
Copy link
Author

Hi @Kiro705, sorry for the late reply.

I tried integrating the IMA SDK directly but encountered an issue where the preroll won't play because it thinks the video has sound, even though it's muted. I attempted to replicate the logic in this plugin regarding sound settings but still faced the same problem.

We can close this, or if you want, we could add support to reinitialize the plugin. This would be a feature/workaround for the IMA SDK limitation, where it doesn't support moving the DOM after the SDK has been initialized. This seems like a useful feature since quite a few people are experiencing similar issues.

On my side, we found a workaround. We are replicating the video playback using a canvas. Video.js is playing behind the slider, and what we show on top is the canvas. When scrolling, the video in the canvas continues playing. Once the slide transitions, we update the canvas to the next active slider. When ads play, we hide the canvas and show Video.js. While the ads are playing, users can't move the slides. So, this workaround is working quite well for us.

Kind regards :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants