KiritoAxinity commited on
Commit
48218e2
·
verified ·
1 Parent(s): 311b8c4

Update public/script.js

Browse files
Files changed (1) hide show
  1. public/script.js +8 -1
public/script.js CHANGED
@@ -304,7 +304,14 @@ function playVideo() {
304
  showTitleAfterDelay(tags);
305
  addVideoTagsToUi(tags);
306
  saveVideoIdToUrl(videoData[CURRENT]);
307
- videoPlayers[CURRENT].play();
 
 
 
 
 
 
 
308
  }
309
 
310
  function showTitleAfterDelay(tags) {
 
304
  showTitleAfterDelay(tags);
305
  addVideoTagsToUi(tags);
306
  saveVideoIdToUrl(videoData[CURRENT]);
307
+
308
+ // Handle the play promise to catch interruptions
309
+ const playPromise = videoPlayers[CURRENT].play();
310
+ if (playPromise !== undefined) {
311
+ playPromise.catch(error => {
312
+ console.log("Playback was prevented or interrupted.");
313
+ });
314
+ }
315
  }
316
 
317
  function showTitleAfterDelay(tags) {