0
Fix this guys
13 Respuestas
+ 5
Did you notice the error message when the script runs? automatic media playback is not supported without page viewer's consent.
Media playback without page viewer's consent is seen as a privacy violation because it takes away page viewers' freedom to decide whether they want auto media playback.
There are workarounds people wrote earlier in the past, as I recall, but you need to browse the Code section to find those examples.
+ Media autoplay guide
https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
(Edit)
You asked about this earlier. To help reduce duplicate questions, please choose only one of the posts and undo the duplicate.
https://www.sololearn.com/Discuss/3216784/?ref=app
+ 5
Leonard Pls fix the question first:
1. Explain what the code should do
2. Explain the problem
3. Remove the "Fix this" part - this section is for you to get help, but not for other people to write code for you
+ 3
zain Shendy
My respond was for Leonard - the OP (Original Poster), not you ...
+ 3
zain Shendy Pls avoid giving finished code as answer, because it makes the OP skip the most important part of learning, and encourage the Bad Habit of asking others to solve one's tasks. Prefer giving hints for the OP to find the solution instead.
Pls also avoid several sparse comments with little or no information. That makes everyone else's experience worse. Try to pack related thougths in a single comment.
0
https://code.sololearn.com/Wd5JnhVIEuQx/?ref=app
Here is the solution
The play() function is only for the user selection, you need to create a button element and give it an id name and say like what i did
0
Hope this help
0
Huh?
0
So my code is wrong?
0
How?
0
Run my code solution
0
Tap on start button and the audio well work
0
He says play() is initiated by user guesture
0
?