* Initializes the callbacks for the player.
()
| 20 | * Initializes the callbacks for the player. |
| 21 | */ |
| 22 | function initialize() { |
| 23 | /* |
| 24 | Event: abort |
| 25 | https://www.w3schools.com/tags/av_event_abort.asp |
| 26 | */ |
| 27 | config.audio.addEventListener("abort", function() { |
| 28 | run("abort"); |
| 29 | }); |
| 30 | |
| 31 | /* |
| 32 | Event: error |
| 33 | https://www.w3schools.com/tags/av_event_error.asp |
| 34 | */ |
| 35 | config.audio.addEventListener("error", function() { |
| 36 | run("error"); |
| 37 | }); |
| 38 | |
| 39 | /* |
| 40 | Event: loadeddata |
| 41 | https://www.w3schools.com/tags/av_event_loadeddata.asp |
| 42 | */ |
| 43 | config.audio.addEventListener("loadeddata", function() { |
| 44 | run("loadeddata"); |
| 45 | }); |
| 46 | |
| 47 | /* |
| 48 | Event: loadedmetadata |
| 49 | https://www.w3schools.com/tags/av_event_loadedmetadata.asp |
| 50 | */ |
| 51 | config.audio.addEventListener("loadedmetadata", function() { |
| 52 | run("loadedmetadata"); |
| 53 | }); |
| 54 | |
| 55 | /* |
| 56 | Event: loadstart |
| 57 | https://www.w3schools.com/tags/av_event_loadstart.asp |
| 58 | */ |
| 59 | config.audio.addEventListener("loadstart", function() { |
| 60 | run("loadstart"); |
| 61 | }); |
| 62 | |
| 63 | /* |
| 64 | Event: pause |
| 65 | https://www.w3schools.com/tags/av_event_pause.asp |
| 66 | */ |
| 67 | config.audio.addEventListener("pause", function() { |
| 68 | run("pause"); |
| 69 | }); |
| 70 | |
| 71 | /* |
| 72 | Event: playing |
| 73 | https://www.w3schools.com/tags/av_event_playing.asp |
| 74 | */ |
| 75 | config.audio.addEventListener("playing", function() { |
| 76 | run("playing"); |
| 77 | }); |
| 78 | |
| 79 | /* |