videojs-ima: Ad freezes in Safari after start
In chrome and Mozilla it works perfectly. In Safari when I trying to start an advert it freezes on 0 second in safari and nothing else happens. To start playing advert I need click on “Pause” button and “Play” button again.
Safari version 11.0 (12604.1.38.1.7) “video.js”: “^5.20.3”, “videojs-ima”: “^0.6.0”
As the video I’m using a mp4 file.
I tried to reproduce this problem in the examples and have same result.
Here I reproduced this issue.
Code which I using:
exports.imaAdPlayer = function (id) {
this.id = id;
this.init = function (autoPlay) {
var player = videojs(this.id);
if (typeof window.imaTagUrl === 'undefined') {
console.debug('[ima] Tag URL is not set');
return player;
}
console.log(window.imaTagUrl);
var options = {
debug: true,
// timeout: 10000,
// prerollTimeout: 1000,
id: id,
adTagUrl: window.imaTagUrl,
};
player.ima(options);
player.one('ready', function () {
player.ima.initializeAdDisplayContainer();
player.ima.requestAds();
});
var contentPlayer = document.getElementById(id + '_html5_api');
if ((navigator.userAgent.match(/iPad/i) ||
navigator.userAgent.match(/Android/i)) &&
contentPlayer.hasAttribute('controls')) {
contentPlayer.removeAttribute('controls');
}
var startEvent = 'click';
if (navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPad/i) ||
navigator.userAgent.match(/Android/i)) {
startEvent = 'touchend';
}
if (typeof autoPlay !== 'undefined' && autoPlay) {
console.debug('[ima] autoplay');
player.ima.initializeAdDisplayContainer();
player.ima.requestAds();
} else {
player.one(startEvent, function () {
console.debug('[ima] default video');
player.ima.initializeAdDisplayContainer();
player.ima.requestAds();
player.play();
});
}
return player;
}
};
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (11 by maintainers)
Hi there - this is a known issue with the IMA SDK in Safari 11. It will be fixed with the next release of the IMA SDK, and the plugin will pick that up automatically.
The plugin never forces any muted state - we just go with what you’ve set on the player. If a VPAID ad wants to auto-play, it’s up to the author of the ad to sync it’s volume with the volume of the content player on start.