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

Delete/Hide overlay #113

Open
martinbkure opened this issue Dec 3, 2019 · 2 comments
Open

Delete/Hide overlay #113

martinbkure opened this issue Dec 3, 2019 · 2 comments

Comments

@martinbkure
Copy link

Description

I'm in a scenario, where related videos are shown below the current video. When you click the related videos, they're played in the same player and only the src is being updated. That means, that the overlays will stay in the player and will be shown, when the new videos are played.

I really can't figure out how to get rid of the existing overlays. I can see in the code, that there is a hide method, but I can't find a way to get rid of all the overlays I've created.

Steps to reproduce

  1. Add a video with overlays and bind them to some events.
  2. Change the src of the player
  3. See that the events are still bound to the player

Results

Expected

Please describe what you expected to see.

Actual

Please describe what actually happened.

Error output

If there are any errors at all, please include them here.

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

what version of videojs does this occur with?

browsers

what browser are affected?

OSes

what platforms (operating systems and devices) are affected?

plugins

are any videojs plugins being used on the page? If so, please list them below.

@martinbkure
Copy link
Author

My solution at the moment is to hide it through css

@gkatsev
Copy link
Member

gkatsev commented Dec 3, 2019

You could use something like using loadstart as the end event for an overlay. That should close the overlay when the loadstart event happens which is when the next video loads. https://github.com/brightcove/videojs-overlay#overlays

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

No branches or pull requests

2 participants