whisper.cat/weboasis/tv/mlb/player.min.js
2023-10-05 23:28:32 +11:00

2 lines
1.7 KiB
JavaScript

var video=document.getElementById("video");function playM3u8(a){if(Hls.isSupported()){video.volume=.3;var b=new Hls,c=decodeURIComponent(a);b.loadSource(c),b.attachMedia(video),b.on(Hls.Events.MANIFEST_PARSED,function(){video.play()}),document.title=a}else video.canPlayType("application/vnd.apple.mpegurl")&&(video.src=a,video.addEventListener("canplay",function(){video.play()}),video.volume=.3,document.title=a)}function playPause(){video.paused?video.play():video.pause()}function volumeUp(){.9>=video.volume&&(video.volume+=.1)}function volumeDown(){.1<=video.volume&&(video.volume-=.1)}function seekRight(){video.currentTime+=5}function seekLeft(){video.currentTime-=5}function vidFullscreen(){video.requestFullscreen?video.requestFullscreen():video.mozRequestFullScreen?video.mozRequestFullScreen():video.webkitRequestFullscreen&&video.webkitRequestFullscreen()}playM3u8("https://cors.club/https://service-stitcher.clusters.pluto.tv/v1/stitch/embed/hls/channel/5e66968a70f34c0007d050be/master.m3u8?deviceId=channel&deviceModel=web&deviceVersion=1.0&appVersion=1.0&deviceType=rokuChannel&deviceMake=rokuChannel&deviceDNT=1&advertisingId=channel&embedPartner=rokuChannel&appName=rokuchannel&is_lat=1&bmodel=bm1&content=channel&platform=web&tags=ROKU_CONTENT_TAGS&coppa=false&content_type=livefeed&rdid=channel&genre=ROKU_ADS_CONTENT_GENRE&content_rating=ROKU_ADS_CONTENT_RATING&studio_id=viacom&channel_id=channel"),$(window).on("load",function(){$("#video").on("click",function(){this.paused?this.play():this.pause()}),Mousetrap.bind("space",playPause),Mousetrap.bind("up",volumeUp),Mousetrap.bind("down",volumeDown),Mousetrap.bind("right",seekRight),Mousetrap.bind("left",seekLeft),Mousetrap.bind("f",vidFullscreen)});