Chen Log

陳洛格

iOS safari sound play

leave a comment »

舊版 iOS safari 網頁播放音效的辦法!

 

音效檔請放在網站自身目錄避免 js 無法讀取!

JAVASCRIPT 範例 EX:

var buzzer = new Audio(‘/mp3/ding.mp3′);
buzzer.load();
buzzer.volume=1;
buzzer.play();

 

 

the Safari Only autoplay ”MP3” file,

dont play other format audio file.

Advertisements

Written by chenagw

2017/02/23 at 00:44

Posted in Uncategorized

Tagged with , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: