Comment by YouTube-r on 20/05/2022 at 19:52 UTC

11 upvotes, 2 direct replies (showing 2)

View submission: Found Reddit video player source code

View parent comment

--------------------------------------------------------------------------------

const VideoHandler = (): void -> {
  if (Video.IsInteresting()) {
    RedditVideoPlayer.Play();
  } else if(Math.random() > 0.5) {
    RedditVideoPlayer.Play();
  } else if(Math.random() < 0.5) {
    RedditVideoPlayer.Play();
  } else if(true) {
    RedditVideoPlayer.Play();
  } else if(!RedditVideoPlayer.isPlaying) {
    RedditVideoPlayer.Play();
 } else if(RedditVideoPlayer.isPlaying) {
    RedditVideoPlayer.Play();
 } else if(true) {
    RedditVideoPlayer.Play();
 } else if(false) {
    RedditVideoPlayer.Play();
}
};

--------------------------------------------------------------------------------

Replies

Comment by OffBrandNameBrand at 20/05/2022 at 20:52 UTC

2 upvotes, 0 direct replies

This is the way, just forgot to make the pause btn also a play button :,)

Comment by YouTube-r at 21/05/2022 at 09:09 UTC

1 upvotes, 0 direct replies

Actually i think this is better

const VideoHandler = (): void -> { if (Video.IsInteresting()) { RedditVideoPlayer.Play(); } else if(Math.random() > 0.5) { RedditVideoPlayer.Play(); } else if(Math.random() < 0.5) { RedditVideoPlayer.Play(); } else if(true) { RedditVideoPlayer.Play(); } else if(!RedditVideoPlayer.isPlaying) { RedditVideoPlayer.Play(); } else if(RedditVideoPlayer.isPlaying) { RedditVideoPlayer.Play(); } else if(true) { RedditVideoPlayer.Play(); } else if(false) { RedditVideoPlayer.Play(); } };