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

Autoplay on iOS 10 #202

Open
nickff opened this issue Dec 6, 2016 · 2 comments
Open

Autoplay on iOS 10 #202

nickff opened this issue Dec 6, 2016 · 2 comments

Comments

@nickff
Copy link

nickff commented Dec 6, 2016

Now that autoplay is possible on iOS 10 devices (see https://webkit.org/blog/6784/new-video-policies-for-ios/), will you be updating the plugin to allow for this? Or can the current version be modified in some way to accomplish this?

Let me know!

@jatasya
Copy link

jatasya commented May 29, 2017

I have fixed this using below code. cause the autoplay is enable in ios 10 and above.

step 1: var UA = navigator.userAgent; //find the useragent

step 2: //implemented the vide plugin
$('.header-container').vide({ mp4: "../newVersion/Assets/Promo Video.mp4", poster: "../newVersion/Assets/Dabkick_API_Desktop.jpg" }, { volume: 0, loop: true, autoplay: true, resizing: true });

step 3: //to make the background video play in ipad with ios 10 and above only
if (UA.match(/iPad/)) { var video = $('.header-container').data('vide'); video.getVideoObject().css({'visiblity': 'visible', 'opacity' : 1}); }

The above code will make the video element visible during loading for ipads, and since autoplay is set to true the background video will start playing

@harryfear
Copy link

harryfear commented Aug 14, 2017

@jatasya, thanks for your help. I reformed the code as such:

if (/iP(hone|od|ad)/.test(navigator.platform)) {
	
		var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
		var ver = [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
		
		if (ver[0] >= 10) {
	
			// Do the magic to reveal the video

		}

	} 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants