Skip to content

Commit

Permalink
❌Video Play/Pause Error
Browse files Browse the repository at this point in the history
- Tied to #56
  • Loading branch information
CryogenicPlanet committed Aug 14, 2020
1 parent c2e7c74 commit 7338456
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/video/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ const Video = ({ url }: { url: string }) => {

// PLAYER FUNCTIONS
function togglePlay() {
if (video.paused) {
video.play();
} else {
video.pause();
try {
if (video.paused) {
video.play();
} else {
video.pause();
}
playBtn.classList.toggle('playing');
} catch (err) {
console.error(err.message, 'Video Object', video);
}
playBtn.classList.toggle('playing');
}
function togglePlayBtn() {
playBtn.classList.toggle('paused');
Expand Down

0 comments on commit 7338456

Please sign in to comment.