javascript - How can krpano play videos inline on an iPhone? -
the iphone (until ios8 @ least) can't play videos inline. every time video starts, video element goes fullscreen; if exit fullscreen video pauses.
this has been rule far noticed krpano can play actual video inline on iphone through webgl: demo
from can tell, use normal <video>
element not attached document:
var v = document.queryselector('video'); // remove document v.parentnode.removechild(v); // touch anywhere play document.ontouchstart = function () { v.play(); }
<video playsinline webkit-playsinline preload="auto" crossorigin="anonymous" src="http://www.mediactiv.com/video/milano.mp4" loop style="transform: translatez(0px);"></video> touch anywhere in here , wait start.
but alone doesn't seem enough: when video played, goes fullscreen.
how manage prevent video going fullscreen?
i figured out, skim video inline , synchronize audio, instead of .play()
'ing it.
i wrote module takes care of playing video , synchronizing audio (but works on videos without sound track): iphone-inline-video
Comments
Post a Comment