Last active
March 6, 2021 22:47
-
-
Save dannyid/52775a76f2a8738334d3 to your computer and use it in GitHub Desktop.
Netflix Seek
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
// The player | |
var player = netflix.cadmium.objects.videoPlayer(); | |
// Metadata about current episode -- ID and url to get frame at a specific time | |
var episodeId = netflix.cadmium.metadata.getActiveVideo().episodeId; | |
var imgRoot = netflix.cadmium.metadata.getActiveVideo().progressImageRoot; | |
// Generates URL of preview image for given timestamp | |
function getFrame(timestamp) { | |
var t = Math.floor(timestamp/10000).toString(10); | |
var f = '00000'.slice(t.length) + t; | |
return imgRoot + f +'.jpg'; | |
}; | |
// Seek to time in milliseconds | |
player.seek(343931); | |
// Example: Get image of current time | |
getFrame(player.getCurrentTime()); |
Now:
var sessionId = videoPlayer.getAllPlayerSessionIds()[0];
var player = videoPlayer.getVideoPlayerBySessionId(sessionId);
player.getMovieId()
player.getTextTrackList()```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My
window.netflix.cadmium.objects
object doesn't have avideoPlayer()
function. Did Netflix remove this?