Ad freezes in Safari after start
See original GitHub issueIn 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;
}
};
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Safari Freezes cause of Adpops - Apple Support Communities
1. Click in the menu bar and choose “Force Quit”.
Read more >How to stop Safari crashing and freezing - Setapp
1. Update Safari through macOS · 2. Restart your WiFi · 3. Turn off unnecessary Safari features · 4. Clear Safari caches ·...
Read more >catalina - Safari won't load, it freezes shortly after I open it and ...
The first thing I would do is close all your tabs then go to the "Safari" menu and select "Clear history..." Change the...
Read more >Safari Crashing on iPhone / iPad? Here is How to Fix Safari ...
6 Fixes for Safari Crashes in iOS · Update iOS System Software · Disable Safari Suggestions Features · Too Many Safari Tabs? Close...
Read more >What to Do if Safari Keeps Crashing on Your Mac - MacKeeper
4. After emptying your caches, restart Safari. Hopefully, it'll have stopped crashing or freezing. Delete Safari history and website data.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.