+ 13

Audio & Video with javascript

How can I play or pause a video or audio by javascript ? I have use... var audio=new Audio('aidio.mp3'); audio.play(); But it doesn't work. So please help me...!

19th Apr 2017, 11:50 PM
Adnan Zawad Toky
Adnan Zawad Toky - avatar
6 Réponses
+ 8
I just notice that for <audio> player element, about another question, which I guess is based on same that <video>... Don't forgot also than readable media types can be differents regarding each browsers ;) ( that's why is provided <source> element )
20th Apr 2017, 12:37 AM
visph
visph - avatar
+ 12
Seems the 'play()' method is not working in sololearn app code playground... Try in web site ^^
20th Apr 2017, 12:12 AM
visph
visph - avatar
+ 9
Thanks for the information
20th Apr 2017, 12:32 AM
Adnan Zawad Toky
Adnan Zawad Toky - avatar
0
no
10th Sep 2017, 2:40 PM
Ferrum
Ferrum - avatar
0
it work
10th Sep 2017, 2:40 PM
Ferrum
Ferrum - avatar