Skip to content Skip to sidebar Skip to footer

Html 5 Audio.playbackrate Not Working In Ipad But Works On Safari On Windows

Following code does not have any effect (audio continues to play in the same manner before pressing the PlayFast button iPad. It works beautifully on Safari on windows box function

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+.

Source: https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-DontLinkElementID_1

Post a Comment for "Html 5 Audio.playbackrate Not Working In Ipad But Works On Safari On Windows"