2 lines
1.6 KiB
JavaScript
2 lines
1.6 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/http://service-stitcher.clusters.pluto.tv/stitch/hls/channel/5ced7d5df64be98e07ed47b6/master.m3u8?terminate=false&deviceType=web&deviceMake=web&deviceModel=web&sid=708&deviceId=5ced7d5df64be98e07ed47b6&deviceVersion=DNT&appVersion=DNT&deviceDNT=0&userId=&advertisingId=&deviceLat=&deviceLon=&app_name=&appName=web&buildVersion=&appStoreUrl=&architecture=&includeExtendedEvents=false&marketingRegion=US&serverSideAds=false"),$(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)});
|