Skip to content

Commit

Permalink
Merge pull request #147 from Blink-drift/Autoplay-update-fix
Browse files Browse the repository at this point in the history
#144 -Fix: Changed button to correctly reflect state during Autoplay
  • Loading branch information
Vinay-Khanagavi authored Oct 28, 2024
2 parents 54d70e1 + a5b015d commit 958e446
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion main/level_1/phishing_animated_video.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ <h1>Please Watch: What does Phishing Look Like?</h1>
video.currentTime = pos * video.duration;
});

video.play().catch(error => {
video.play().then(() => {
playPauseBtn.textContent = 'Pause'
console.log("Video is playing automatically.");
}).catch(error => {
console.log("Auto-play prevented:", error);
});

Expand Down
5 changes: 4 additions & 1 deletion main/level_2/phishing_animated_video.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ <h1>Please Watch: What is Malware?</h1>
video.currentTime = pos * video.duration;
});

video.play().catch(error => {
video.play().then(() => {
playPauseBtn.textContent = 'Pause'
console.log("Video is playing automatically.");
}).catch(error => {
console.log("Auto-play prevented:", error);
});

Expand Down
5 changes: 4 additions & 1 deletion main/level_3/phishing_animated_video.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ <h1>Please Watch: What does a Good Password Look Like?</h1>
video.currentTime = pos * video.duration;
});

video.play().catch(error => {
video.play().then(() => {
playPauseBtn.textContent = 'Pause'
console.log("Video is playing automatically.");
}).catch(error => {
console.log("Auto-play prevented:", error);
});

Expand Down

0 comments on commit 958e446

Please sign in to comment.