Closed Barahten closed 4 years ago
Hello @Barahten ,
It looks like there are a few issues in your jsfiddle implementation.
I would look to the following code simplified from the plugin's simple example to resolve your issues.
var player = videojs('content_video');
var options = {
id: 'content_video',
adTagUrl: 'http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&' +
'iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&' +
'impl=s&gdfp_req=1&env=vp&output=xml_vmap1&unviewed_position_start=1&' +
'cust_params=sample_ar%3Dpremidpostpod%26deployment%3Dgmf-js&cmsid=496&' +
'vid=short_onecue&correlator='
};
player.ima(options);
// Initialize the ad container when the video player is clicked, but only the first time it's clicked.
var initAdDisplayContainer = function() {
player.ima.initializeAdDisplayContainer();
wrapperDiv.removeEventListener('click', initAdDisplayContainer);
}
var wrapperDiv = document.getElementById('content_video');
wrapperDiv.addEventListener('click', initAdDisplayContainer);
Please let me know if you have any other questions.
Hello, @Kiro705 Yes, it seems to have helped. Thank
Hey. I decided not to create a new Issue, I will ask here. Is it possible to get CuePoint if the player is set to Autoplay?
I've updated the example. If the player is set to Autoplay, then advertising markers are not displayed until you click on any player control. Run the example and do not click on any player control, wait until the ad finishes playing. Then, after the ad ends, the main video will start playing. If you click on a button, for example, Pause, then ad markers will appear on the timeline.
This example works fine with manually starting the player, but not with Autoplay. Are there any ways to fix this problem? Thanks in advance
if Autoplay doesn't work, start the player manually. Then run the example again (Run button on top left)
Example http://jsfiddle.net/gtc30q74/
Hello @Barahten ,
The reason the markers are not displayed, is that the initAdDisplayContainer
function is only being called when the adUi is clicked. I would recommend moving the initAdDisplayContainer
function to an initiation step, so it is called every time and not just on clicks.
Hello @Barahten ,
The reason the markers are not displayed, is that the
initAdDisplayContainer
function is only being called when the adUi is clicked. I would recommend moving theinitAdDisplayContainer
function to an initiation step, so it is called every time and not just on clicks.
Hey. Sorry, I didn't quite understand you: to the step of launching what? Could you show the simplest example?
Launching the page or application, or something that happens every time the page loads. The way it was set up in the example, it was only called on click, so if the user never clicked, the markers could not be set.
Using one of the plugin ad events may be a way to make sure this is called on every ad request.
Launching the page or application, or something that happens every time the page loads. The way it was set up in the example, it was only called on click, so if the user never clicked, the markers could not be set.
Using one of the plugin ad events may be a way to make sure this is called on every ad request.
what event do you recommend to hang this function? Can you give a short example?
I would recommend doing this once an ad request is made:
this.player.on('ads-manager', function(response){
initAdDisplayContainer();
})
In the latest version of the plugin, I see the following problems when working with some VAST
Example here http://jsfiddle.net/3f72qmu6/3/