Open manumohant opened 8 years ago
We managed to get it to work using the vast.adStart event.
player.on('vast.adStart', function(evt) { console.log('Ad Started!'); player.volume(0); });
yeah, same thing is using here too. But the problem is the muted() method not working
Hi!, do you get mute work? I have tried.but it's not work me too.. Demos are made here:
http://chative.com/ad/imesh/videetv-mute.php
http://chative.com/ad/imesh/adaptv-mute.php
also, i have add auto play function,to this.. but ads not load with auto play..how do i get ads work with auto play... any idea?
Best, Shawn
You have to call play() method on player to start ad automatically. I don't think adding auto play to video element will do this job. And you don't need to initialize player twice.
Like this: player.on('vast.adStart', function(evt) { console.log('Ad Started!'); player.play(); player.volume(0); });
is that work for you?
sorry!, can you gave me exact code? if you don't mine..
There's no meaning of calling play() inside 'adStart' event. Try calling play() just after initializing player and listeners . You can do something like this
player = videojs(videoEl, adPluginOpts);
player.on('vast.adStart', function(evt) {
console.log('Ad Started!');
player.volume(0);
});
player.play();
Note: If player.play()
is not working, try calling player.vast.adUnit.playAd()
its working only for html5 ads, the flash version doesn't work still. update: actually it is working in the flash version of 1.0.2 (but not 1.0.1)
@shachr Check your AdTag URL here http://manumohant.github.io/ . It should support both HTML and flash(any version). Source is available here https://github.com/manumohant/video-js-vast-vpaid-no-cors . Check it out,
Its really interesting!!!. Below is my code.
player = videojs(videoEl, adPluginOpts); player.muted(true); player.play();
Its doesn't have any effect. Even pure HTML5 muted='true' also not working with "videojs-vast-vpaid". Any solutions??