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

how to change content source correctly #346

Closed
Pong420 opened this issue Mar 8, 2018 · 6 comments
Closed

how to change content source correctly #346

Pong420 opened this issue Mar 8, 2018 · 6 comments
Labels

Comments

@Pong420
Copy link

Pong420 commented Mar 8, 2018

Hi,

i am working on resolution change by changing video source, but seems conflict with this plugin, player is stalled around 5 second after source change

screen shot 2018-03-08 at 11 46 38 am

@incompl
Copy link
Contributor

incompl commented Mar 8, 2018

The main thing I suggest is to not do source changes during ad mode. Is player.ads.isInAdMode() true when you are changing sources? If you want to change sources during an ad, I suggest you first end the ad.

@Pong420
Copy link
Author

Pong420 commented Mar 9, 2018

player.ads.isInAdMode() is false

screen shot 2018-03-09 at 11 04 36 am

@incompl
Copy link
Contributor

incompl commented Mar 9, 2018

Hmm this all seems OK. The error you're seeing in the console is a normal result of how cancelContentPlay works (we're changing how that works in this PR which will make that error go away).

I'm curious to know more about the state of the player when it is stalled. Is it paused? What is displayed visually?

If you could share an example that demonstrates the issue that would help a lot too.

@Pong420
Copy link
Author

Pong420 commented Mar 12, 2018

Sorry, i am not state clearly.

Action
Change another video source and receive a loadedmetadata event

Expectation
The player continue to play

Result
The player continue to play after 5 second

So my problem is how to remove the 5 second.
If set timeout to 0 work fine, but i worry that this may cause other problems

Here is the example, after video ad ended, click on the button to change video
https://ads-issue-346.herokuapp.com/

@incompl
Copy link
Contributor

incompl commented Mar 12, 2018

Ah I see, this is because the plugin does preroll checks again after you change sources. You can either play a preroll the same way you do for the initial source, or you can trigger a nopreroll event on the player like this: player.trigger('nopreroll');

@Pong420
Copy link
Author

Pong420 commented Mar 13, 2018

thanks so much~

@Pong420 Pong420 closed this as completed Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants