Skip to content

Instantly share code, notes, and snippets.

@ilhamgusti
Created January 13, 2023 06:42
Show Gist options
  • Save ilhamgusti/63e6259f7e40c627a08aad026d8b2ae4 to your computer and use it in GitHub Desktop.
Save ilhamgusti/63e6259f7e40c627a08aad026d8b2ae4 to your computer and use it in GitHub Desktop.
sync player, nobar tanpa restream / re-broadcast video (proof of concept)
// get current existing video element
const video = document.querySelector('video');
// catch seeked event
video.addEventListener('seeked', (event) => {
// TODO: checking position time seek.
// send/broadcast seeking time to websocket
console.log('Video found the playback position it was looking for.');
});
// video.currentTime is a current time of seeking
// adjust current time seeking point from broadcast data ws.
//TODO: extension chrome for manipulation video, send data via websocket. synced to other people. enjoy watching together aka nobar
// documentation reference: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment