Created
January 13, 2023 06:42
-
-
Save ilhamgusti/63e6259f7e40c627a08aad026d8b2ae4 to your computer and use it in GitHub Desktop.
sync player, nobar tanpa restream / re-broadcast video (proof of concept)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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