Playing audio on iPad

后端 未结 5 763
囚心锁ツ
囚心锁ツ 2020-12-16 15:00

I\'m working on a website that has a chat for a client, however, we\'re experiencing problems with audio in iPad (iOS 5).

The target is in fact the iPad with support

5条回答
  •  抹茶落季
    2020-12-16 15:31

    Source code(version simple)

    HTML

     
    Enable Sound

    JS

    var sound = new Audio("/Assets/audio/yourAudio.mp3");;
     $("#enableSound").click(function() {
         sound.play();
      });
    

    User has to click on div "#enableSound", from that moment on whenever you want to play above sound, just call

    sound.play()
    

    http://jsbin.com/virixukavo/1/edit?html,js,output

提交回复
热议问题