Html 5 Audio.playbackrate Not Working In Ipad But Works On Safari On Windows
Solution 1:
To give an updated answer with the official statement from Apple on iOS:
You can set the audio or video playbackRate property to nonzero values to play media in slow motion (values >0 and <1) or fast forward (values >1) in Safari on the desktop. Setting playbackRate is not currently supported on iOS.
Having said that I have managed to change the playbackRate on iPad/iOS7 with the following code. It seems you need to pause the video before the playbackRate can be set. I am just wondering now if the Apple document is up to date (?)
<videocontrolsid="videoTag"width="640"height="360"preload="none"><sourcesrc="media/360p.mp4"type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'id="mp4Source"></video><divid="change">change rate to x2</div><divid="change2">change rate to x0.5</div><scripttype="text/javascript">var video = document.getElementById('videoTag');
video.addEventListener('canplay',function(){
document.getElementById('change').addEventListener('click',function(){
video.pause();
video.playbackRate = 2.0;
video.play();
},false);
document.getElementById('change2').addEventListener('click',function(){
video.pause();
video.playbackRate = 0.5;
video.play();
},false);
},false);
</script>
Solution 2:
Playback Rate in JavaScript
You can set the audio or video playbackRate property to nonzero values to play media in slow motion (values >0 and <1) or fast forward (values >1) in Safari on the desktop. Setting playbackRate is not currently supported on iOS.
Solution 3:
You can set the audio or video playbackRate property to nonzero values to play media in slow motion (values >0 and <1) or fast forward (values >1) in Safari on the desktop and iOS 6+.
Post a Comment for "Html 5 Audio.playbackrate Not Working In Ipad But Works On Safari On Windows"