Avatar of bidgadget
bidgadgetFlag for United States of America

asked on 

HTML Audio speed control works on windows but not on MAC

I have written a site that plays mp3 audio files.   I have three buttons that allows the listener to change the speed of the audio.  It works perfect when playing on any windows computer, however when it is play on MAC it does not work at all.    Here is my code.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>

    <style>
        button {
            display: inline-block;
            margin: 5px; /* space between buttons */
            background: #000000; /* background color */
            color: #ffffff; /* text color */
            font-size: 1em;
            font-family: ‘Georgia’, serif;
            font-style: normal;
            border-radius: 50px; /* rounded corners */
            padding: 8px 16px; /* space around text */
            -moz-transition: all 0.2s;
            -webkit-transition: all 0.2s;
            transition: all 0.2s;
            float: unset;
        }
    </style>

    <video id="myVideo" width="320" height="176" controls>
        <source src="audio/audio/cio.mp3" type="video/mp4">
        <source src="mov_bbb.ogg" type="video/ogg">
        Your browser does not support HTML5 video.
    </video>
    <div class="buttons">

        <div class="action_btn">

            <button name="SpeedX 1.5" class="action_btn submit" type="submit" value="Save" onclick="setPlaySpeed()">x1.2</button>
            <button name="SpeedX 1" class="action_btn cancel" type="submit" value="Cancel" onclick="setPlaySpeed3()">x1.5</button>
            <button name="SpeedX 1" class="action_btn cancel" type="submit" value="Cancel" onclick="setPlaySpeed4()">x1</button>

            <p id="saved"></p>

        </div>

    </div>






    <script>
        var vid = document.getElementById("myVideo");

        function getPlaySpeed() {
            alert(vid.playbackRate);
        }

        function setPlaySpeed() {
            vid.playbackRate = 1.2;
        }

        function setPlaySpeed3() {
            vid.playbackRate = 1.5;
        }

        function setPlaySpeed4() {
            vid.playbackRate = 1;
        }



    </script>



</body>



</html>


Open in new window

HTMLMultiMedia ApplicationsWindows OSMac OS XDigital Audio

Avatar of undefined
Last Comment
David H.H.Lee
ASKER CERTIFIED SOLUTION
Avatar of David H.H.Lee
David H.H.Lee
Flag of Malaysia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Windows OS
Windows OS

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo