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
document.querySelector('body > div:nth-child(1)').style.display = 'none'; | |
var videoPlayer = netflix.appContext.state.playerApp.getAPI().videoPlayer; | |
var playerSessionId = videoPlayer.getAllPlayerSessionIds()[0]; | |
var player = videoPlayer.getVideoPlayerBySessionId(playerSessionId); | |
var endTime = player.getTimeCodes().find(x => x.type === 'ending').endOffsetMs; | |
var togglePause = () => { | |
console.log('is paused', player.isPaused(), player.getPaused(), player.isPlaying(), player.getPlaying()); | |
player.isPaused() ? player.play() : player.pause(); |
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
[ | |
{ | |
"mimeType": "video/mp4; codecs=\"avc1.64001F, mp4a.40.2\"", | |
"qualityLabel": "720p", | |
"bitrate": 2404385, | |
"audioBitrate": 192, | |
"itag": 22, | |
"width": 1280, | |
"height": 720, | |
"lastModified": "1540060663562737", |
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
[ | |
{ | |
"s": "ee=ABRQQLoGagBJMMqOIMQp19=LEHMtCNV5GdkeLasImc3AiAv-3T0AynUPsxsRXXNfYGKuVA_DbyZZGNl6ICBOTLMDNAhIQRww2IxgLc", | |
"quality": "hd720", | |
"itag": "22", | |
"type": "video/mp4; codecs=\"avc1.64001F, mp4a.40.2\"", | |
"url": "https://r2---sn-a5mlrnez.googlevideo.com/videoplayback?expire=1574890756&ei=pJjeXZTVEIuPkgbfmZewCQ&ip=100.67.164.99&id=o-AOJGE_diu8sNHE-vP4nK7k7ssq1M-cYi-a_lcRN2NMGk&itag=22&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-a5mlrnez%2Csn-a5meknlz&ms=au%2Crdu&mv=u&mvi=1&pl=24&gcr=us&mime=video%2Fmp4&ratebypass=yes&dur=218.685&lmt=1540060663562737&mt=1574868682&fvip=2&fexp=23842630&c=WEB&txp=5431432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cmime%2Cratebypass%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AHylml4wRQIhAJToTcAR8Zwu6hDMuzEuNqPIOwNWzlMzKsS93DPQEGKnAiBlijo-9b_KPhYcjl8jyhhqNSKqicejuktg9hQOnnNuHw%3D%3D&sig=ALgxI2wwRQIhANDMLTOBCI6cNGZZybD_lVuKGYfNXXRsxsPUnyA0T3-vAiA3cmIsaLekdG5VNCtMHELe91pQMIOqMMJBgaGoLQQRBA%3D%3D", | |
"sp": "sig", | |
"co |
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
let readJson = () => | |
new Promise(resolve => { | |
let input = document.createElement('input'); | |
input.type = 'file'; | |
input.accept = 'application/json'; | |
input.click(); | |
input.addEventListener('change', () => { | |
let fr = new FileReader(); | |
fr.readAsText(input.files[0]); | |
fr.addEventListener('load', () => resolve(fr.result)); |
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
<canvas width="100" height="100"></canvas> | |
<script> | |
let canvas = document.querySelector('canvas'); | |
let ctx = canvas.getContext('2d'); | |
ctx.strokeRect(20, 20, 30, 30); | |
let d = () => { | |
canvas.toBlob(blob => { |
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
<div><input type="number" value="50"></div> | |
<div><input type="number" value="0"></div> | |
<canvas width='1000' height='1000'></canvas> | |
<script> | |
let [sizeInput, adjustInput] = document.querySelectorAll('input'); | |
let canvas = document.querySelector('canvas'); | |
let ctx = canvas.getContext('2d'); |
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
<style> | |
#container { | |
display: flex; | |
flex-direction: row; | |
width: 400px; | |
margin-top: 20px; | |
} | |
span { | |
flex-grow: 1; |
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
let n = 1000000; | |
let record = {}; | |
for (let i = 0; i < n; i++) { | |
let shuffled = [1, 2, 3].sort(() => Math.random() - .5); | |
record[shuffled] = (record[shuffled] || 0) + 1; | |
} | |
Object.entries(record).map(([key, count]) => | |
console.log(key, Math.floor(count / n * 10000) / 100)); |
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
<style> | |
body { | |
display: flex; | |
align-items: center; | |
} | |
.parent { | |
display: flex; | |
align-items: center; | |
flex-direction: column; |
NewerOlder