()
| 33 | // If the video playback is paused or ended, the video is played |
| 34 | // otherwise, the video is paused |
| 35 | function togglePlay() { |
| 36 | if (video.paused || video.ended) { |
| 37 | video.play(); |
| 38 | } else { |
| 39 | video.pause(); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // updatePlayButton updates the playback icon and tooltip |
| 44 | // depending on the playback state |