1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

switch to hwaccel auto

This commit is contained in:
Luke Pulverenti 2017-04-21 16:03:07 -04:00
parent 11ff774a32
commit 4fdb2a3500
14 changed files with 14 additions and 14 deletions

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
define(["browser","dom","layoutManager","shell","embyRouter","apphost","css!./emby-button","registerElement"],function(browser,dom,layoutManager,shell,embyRouter,appHost){"use strict";function animateButtonInternal(e,btn){for(var div=document.createElement("div"),i=0,length=btn.classList.length;i<length;i++)div.classList.add(btn.classList[i]+"-ripple-effect");var offsetX=e.offsetX||0,offsetY=e.offsetY||0;offsetX>0&&offsetY>0&&(div.style.left=offsetX+"px",div.style.top=offsetY+"px");var firstChild=btn.firstChild;firstChild?btn.insertBefore(div,btn.firstChild):btn.appendChild(div),div.addEventListener(dom.whichAnimationEvent(),function(){div.parentNode.removeChild(div)},!1)}function animateButton(e,btn){requestAnimationFrame(function(){animateButtonInternal(e,btn)})}function onKeyDown(e){13===e.keyCode&&animateButton(e,this)}function onMouseDown(e){0===e.button&&animateButton(e,this)}function onClick(e){animateButton(e,this)}function enableAnimation(){return!browser.tv}function onClickOpenTarget(e){shell.openUrl(this.getAttribute("data-target"))}function onAnchorClick(e){var href=this.getAttribute("href");"#"!==href&&(this.getAttribute("target")?(e.preventDefault(),shell.openUrl(href)):embyRouter.handleAnchorClick(e))}var EmbyButtonPrototype=Object.create(HTMLButtonElement.prototype),EmbyLinkButtonPrototype=Object.create(HTMLAnchorElement.prototype);EmbyButtonPrototype.createdCallback=function(){this.classList.contains("emby-button")||(this.classList.add("emby-button"),browser.safari&&this.classList.add("emby-button-noflex"),layoutManager.tv&&(this.classList.add("emby-button-focusscale"),this.classList.add("emby-button-tv")),enableAnimation()&&(dom.addEventListener(this,"keydown",onKeyDown,{passive:!0}),browser.safari?dom.addEventListener(this,"click",onClick,{passive:!0}):dom.addEventListener(this,"mousedown",onMouseDown,{passive:!0})))},EmbyButtonPrototype.attachedCallback=function(){"A"===this.tagName?(dom.removeEventListener(this,"click",onAnchorClick,{}),dom.addEventListener(this,"click",onAnchorClick,{})):this.getAttribute("data-target")&&(dom.removeEventListener(this,"click",onClickOpenTarget,{passive:!0}),dom.addEventListener(this,"click",onClickOpenTarget,{passive:!0}),"false"!==this.getAttribute("data-autohide")&&(appHost.supports("externallinks")?this.classList.remove("hide"):this.classList.add("hide")))},EmbyLinkButtonPrototype.createdCallback=EmbyButtonPrototype.createdCallback,EmbyLinkButtonPrototype.attachedCallback=EmbyButtonPrototype.attachedCallback,document.registerElement("emby-button",{prototype:EmbyButtonPrototype,extends:"button"}),document.registerElement("emby-linkbutton",{prototype:EmbyLinkButtonPrototype,extends:"a"})});
define(["browser","dom","layoutManager","shell","embyRouter","apphost","css!./emby-button","registerElement"],function(browser,dom,layoutManager,shell,embyRouter,appHost){"use strict";function animateButtonInternal(e,btn){for(var div=document.createElement("div"),i=0,length=btn.classList.length;i<length;i++)div.classList.add(btn.classList[i]+"-ripple-effect");var offsetX=e.offsetX||0,offsetY=e.offsetY||0;offsetX>0&&offsetY>0&&(div.style.left=offsetX+"px",div.style.top=offsetY+"px");var firstChild=btn.firstChild;firstChild?btn.insertBefore(div,btn.firstChild):btn.appendChild(div),div.addEventListener(dom.whichAnimationEvent(),function(){div.parentNode.removeChild(div)},!1)}function animateButton(e,btn){requestAnimationFrame(function(){animateButtonInternal(e,btn)})}function onKeyDown(e){13===e.keyCode&&animateButton(e,this)}function onMouseDown(e){0===e.button&&animateButton(e,this)}function onClick(e){animateButton(e,this)}function enableAnimation(){return!browser.tv}function onClickOpenTarget(e){shell.openUrl(this.getAttribute("data-target"))}function onAnchorClick(e){var href=this.getAttribute("href");"#"!==href&&(this.getAttribute("target")?(e.preventDefault(),shell.openUrl(href)):embyRouter.handleAnchorClick(e))}var EmbyButtonPrototype=Object.create(HTMLButtonElement.prototype),EmbyLinkButtonPrototype=Object.create(HTMLAnchorElement.prototype);EmbyButtonPrototype.createdCallback=function(){this.classList.contains("emby-button")||(this.classList.add("emby-button"),browser.safari&&this.classList.add("emby-button-noflex"),layoutManager.tv&&(this.classList.add("emby-button-focusscale"),this.classList.add("emby-button-tv")),enableAnimation()&&(dom.addEventListener(this,"keydown",onKeyDown,{passive:!0}),browser.safari||browser.firefox&&"A"===this.tagName?dom.addEventListener(this,"click",onClick,{passive:!0}):dom.addEventListener(this,"mousedown",onMouseDown,{passive:!0})))},EmbyButtonPrototype.attachedCallback=function(){"A"===this.tagName?(dom.removeEventListener(this,"click",onAnchorClick,{}),dom.addEventListener(this,"click",onAnchorClick,{})):this.getAttribute("data-target")&&(dom.removeEventListener(this,"click",onClickOpenTarget,{passive:!0}),dom.addEventListener(this,"click",onClickOpenTarget,{passive:!0}),"false"!==this.getAttribute("data-autohide")&&(appHost.supports("externallinks")?this.classList.remove("hide"):this.classList.add("hide")))},EmbyLinkButtonPrototype.createdCallback=EmbyButtonPrototype.createdCallback,EmbyLinkButtonPrototype.attachedCallback=EmbyButtonPrototype.attachedCallback,document.registerElement("emby-button",{prototype:EmbyButtonPrototype,extends:"button"}),document.registerElement("emby-linkbutton",{prototype:EmbyLinkButtonPrototype,extends:"a"})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
.videoPlayerContainer{position:fixed!important;top:0;bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.videoPlayerContainer:not(.videoPlayerContainer-withBackdrop){background:#000!important}.videoPlayerContainer-withBackdrop{background-repeat:no-repeat;background-position:center center;-webkit-background-size:cover;background-size:cover;background-attachment:fixed;background-color:#000}.videoPlayerContainer-onTop{z-index:1000}.htmlvideoplayer{margin:0!important;padding:0!important;width:100%;height:100%}.htmlvideoplayer::-webkit-media-text-track-display{margin-top:-2.5em}.htmlvideoplayer::cue{background-color:transparent;text-shadow:2px 2px 2px rgba(0,0,0,1);-webkit-font-smoothing:antialiased;font-family:inherit}.videoSubtitles{position:fixed;bottom:10%;text-align:center;left:0;right:0;color:#fff;font-size:150%}.videoSubtitlesInner{max-width:70%;background-color:rgba(0,0,0,.8);padding:.25em;margin:auto;display:inline-block}@-webkit-keyframes htmlvideoplayer-zoomin{from{-webkit-transform:scale3d(.2,.2,.2);transform:scale3d(.2,.2,.2);opacity:.6}to{-webkit-transform:none;transform:none;opacity:initial}}@keyframes htmlvideoplayer-zoomin{from{-webkit-transform:scale3d(.2,.2,.2);transform:scale3d(.2,.2,.2);opacity:.6}to{-webkit-transform:none;transform:none;opacity:initial}}
.videoPlayerContainer{position:fixed!important;top:0;bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.videoPlayerContainer:not(.videoPlayerContainer-withBackdrop){background:#000!important}.videoPlayerContainer-withBackdrop{background-repeat:no-repeat;background-position:center center;-webkit-background-size:cover;background-size:cover;background-attachment:fixed;background-color:#000}.videoPlayerContainer-onTop{z-index:1000}.htmlvideoplayer{margin:0!important;padding:0!important;width:100%;height:100%}.htmlvideoplayer::-webkit-media-text-track-display{margin-top:-2.5em}.htmlvideoplayer::cue{background-color:transparent;text-shadow:2px 2px 2px rgba(0,0,0,1);-webkit-font-smoothing:antialiased;font-family:inherit}.videoSubtitles{position:fixed;bottom:10%;text-align:center;left:0;right:0;color:#fff;font-size:170%}.videoSubtitlesInner{max-width:70%;background-color:rgba(0,0,0,.8);padding:.25em;margin:auto;display:inline-block}@-webkit-keyframes htmlvideoplayer-zoomin{from{-webkit-transform:scale3d(.2,.2,.2);transform:scale3d(.2,.2,.2);opacity:.6}to{-webkit-transform:none;transform:none;opacity:initial}}@keyframes htmlvideoplayer-zoomin{from{-webkit-transform:scale3d(.2,.2,.2);transform:scale3d(.2,.2,.2);opacity:.6}to{-webkit-transform:none;transform:none;opacity:initial}}

View file

@ -1 +1 @@
define(["appSettings","pluginManager"],function(appSettings,pluginManager){"use strict";function PackageManager(){function addPackage(pkg){packages=packages.filter(function(p){return p.name!==pkg.name}),packages.push(pkg)}function removeUrl(url){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");manifestUrls=manifestUrls.filter(function(i){return i!==url}),appSettings.set(settingsKey,JSON.stringify(manifestUrls))}function loadPackage(url,throwError){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest,originalUrl=url;url+=url.indexOf("?")===-1?"?":"&",url+="t="+(new Date).getTime(),xhr.open("GET",url,!0);var onError=function(){throwError===!0?reject():(removeUrl(originalUrl),resolve())};xhr.onload=function(e){if(this.status<400){var pkg=JSON.parse(this.response);pkg.url=originalUrl,addPackage(pkg);var plugins=pkg.plugins||[];pkg.plugin&&plugins.push(pkg.plugin);var promises=plugins.map(function(pluginUrl){return pluginManager.loadPlugin(self.mapPath(pkg,pluginUrl))});Promise.all(promises).then(resolve,resolve)}else onError()},xhr.onerror=onError,xhr.send()})}var self=this,settingsKey="installedpackages1",packages=[];self.packages=function(){return packages.slice(0)},self.install=function(url){return loadPackage(url,!0).then(function(pkg){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return manifestUrls.indexOf(url)===-1&&(manifestUrls.push(url),appSettings.set(settingsKey,JSON.stringify(manifestUrls))),pkg})},self.uninstall=function(name){var pkg=packages.filter(function(p){return p.name===name})[0];return pkg&&(packages=packages.filter(function(p){return p.name!==name}),removeUrl(pkg.url)),Promise.resolve()},self.init=function(){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return Promise.all(manifestUrls.map(loadPackage)).then(function(){return Promise.resolve()},function(){return Promise.resolve()})}}return PackageManager.prototype.mapPath=function(pkg,pluginUrl){var urlLower=pluginUrl.toLowerCase();if(0===urlLower.indexOf("http:")||0===urlLower.indexOf("https:")||0===urlLower.indexOf("file:"))return pluginUrl;var packageUrl=pkg.url;return packageUrl=packageUrl.substring(0,packageUrl.lastIndexOf("/")),packageUrl+="/",packageUrl+=pluginUrl},new PackageManager});
define(["appSettings","pluginManager"],function(appSettings,pluginManager){"use strict";function addPackage(packageManager,pkg){packageManager.packagesList=packageManager.packagesList.filter(function(p){return p.name!==pkg.name}),packageManager.packagesList.push(pkg)}function removeUrl(url){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");manifestUrls=manifestUrls.filter(function(i){return i!==url}),appSettings.set(settingsKey,JSON.stringify(manifestUrls))}function loadPackage(packageManager,url,throwError){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest,originalUrl=url;url+=url.indexOf("?")===-1?"?":"&",url+="t="+(new Date).getTime(),xhr.open("GET",url,!0);var onError=function(){throwError===!0?reject():(removeUrl(originalUrl),resolve())};xhr.onload=function(e){if(this.status<400){var pkg=JSON.parse(this.response);pkg.url=originalUrl,addPackage(packageManager,pkg);var plugins=pkg.plugins||[];pkg.plugin&&plugins.push(pkg.plugin);var promises=plugins.map(function(pluginUrl){return pluginManager.loadPlugin(packageManager.mapPath(pkg,pluginUrl))});Promise.all(promises).then(resolve,resolve)}else onError()},xhr.onerror=onError,xhr.send()})}function PackageManager(){this.packagesList=[]}var settingsKey="installedpackages1";return PackageManager.prototype.init=function(){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return Promise.all(manifestUrls.map(loadPackage)).then(function(){return Promise.resolve()},function(){return Promise.resolve()})},PackageManager.prototype.packages=function(){return this.packagesList.slice(0)},PackageManager.prototype.install=function(url){return loadPackage(url,!0).then(function(pkg){var manifestUrls=JSON.parse(appSettings.get(settingsKey)||"[]");return manifestUrls.indexOf(url)===-1&&(manifestUrls.push(url),appSettings.set(settingsKey,JSON.stringify(manifestUrls))),pkg})},PackageManager.prototype.uninstall=function(name){var pkg=this.packagesList.filter(function(p){return p.name===name})[0];return pkg&&(this.packagesList=this.packagesList.filter(function(p){return p.name!==name}),removeUrl(pkg.url)),Promise.resolve()},PackageManager.prototype.mapPath=function(pkg,pluginUrl){var urlLower=pluginUrl.toLowerCase();if(0===urlLower.indexOf("http:")||0===urlLower.indexOf("https:")||0===urlLower.indexOf("file:"))return pluginUrl;var packageUrl=pkg.url;return packageUrl=packageUrl.substring(0,packageUrl.lastIndexOf("/")),packageUrl+="/",packageUrl+=pluginUrl},new PackageManager});

View file

@ -1 +1 @@
define(["events"],function(events){"use strict";function pluginManager(){function loadStrings(plugin,globalize){var strings=plugin.getTranslations?plugin.getTranslations():[];return globalize.loadStrings({name:plugin.id||plugin.packageName,strings:strings})}function definePluginRoute(route,plugin){route.contentPath=self.mapPath(plugin,route.path),route.path=self.mapRoute(plugin,route),Emby.App.defineRoute(route,plugin.id)}var self=this,plugins=[];self.register=function(obj){plugins.push(obj),events.trigger(self,"registered",[obj])},self.ofType=function(type){return plugins.filter(function(o){return o.type===type})},self.plugins=function(){return plugins},self.mapRoute=function(plugin,route){return"string"==typeof plugin&&(plugin=plugins.filter(function(p){return(p.id||p.packageName)===plugin})[0]),route=route.path||route,0===route.toLowerCase().indexOf("http")?route:"/plugins/"+plugin.id+"/"+route};var cacheParam=(new Date).getTime();self.mapPath=function(plugin,path,addCacheParam){"string"==typeof plugin&&(plugin=plugins.filter(function(p){return(p.id||p.packageName)===plugin})[0]);var url=plugin.baseUrl+"/"+path;return addCacheParam&&(url+=url.indexOf("?")===-1?"?":"&",url+="v="+cacheParam),url},self.loadPlugin=function(url){return console.log("Loading plugin: "+url),new Promise(function(resolve,reject){require([url,"globalize","embyRouter"],function(pluginFactory,globalize,embyRouter){var plugin=new pluginFactory,existing=plugins.filter(function(p){return p.id===plugin.id})[0];if(existing)return void resolve(url);plugin.installUrl=url;var urlLower=url.toLowerCase();urlLower.indexOf("http:")===-1&&urlLower.indexOf("https:")===-1&&urlLower.indexOf("file:")===-1&&0!==url.indexOf(embyRouter.baseUrl())&&(url=embyRouter.baseUrl()+"/"+url);var separatorIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));plugin.baseUrl=url.substring(0,separatorIndex);var paths={};paths[plugin.id]=plugin.baseUrl,requirejs.config({waitSeconds:0,paths:paths}),self.register(plugin),plugin.getRoutes&&plugin.getRoutes().forEach(function(route){definePluginRoute(route,plugin)}),"skin"===plugin.type?resolve(plugin):loadStrings(plugin,globalize).then(function(){resolve(plugin)},reject)})})}}var instance=new pluginManager;return window.Emby=window.Emby||{},window.Emby.PluginManager=instance,instance});
define(["events"],function(events){"use strict";function loadStrings(plugin,globalize){var strings=plugin.getTranslations?plugin.getTranslations():[];return globalize.loadStrings({name:plugin.id||plugin.packageName,strings:strings})}function definePluginRoute(pluginManager,route,plugin){route.contentPath=pluginManager.mapPath(plugin,route.path),route.path=pluginManager.mapRoute(plugin,route),Emby.App.defineRoute(route,plugin.id)}function PluginManager(){this.pluginsList=[]}var cacheParam=(new Date).getTime();PluginManager.prototype.loadPlugin=function(url){console.log("Loading plugin: "+url);var self=this;return new Promise(function(resolve,reject){require([url,"globalize","embyRouter"],function(pluginFactory,globalize,embyRouter){var plugin=new pluginFactory,existing=self.pluginsList.filter(function(p){return p.id===plugin.id})[0];if(existing)return void resolve(url);plugin.installUrl=url;var urlLower=url.toLowerCase();urlLower.indexOf("http:")===-1&&urlLower.indexOf("https:")===-1&&urlLower.indexOf("file:")===-1&&0!==url.indexOf(embyRouter.baseUrl())&&(url=embyRouter.baseUrl()+"/"+url);var separatorIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));plugin.baseUrl=url.substring(0,separatorIndex);var paths={};paths[plugin.id]=plugin.baseUrl,requirejs.config({waitSeconds:0,paths:paths}),self.register(plugin),plugin.getRoutes&&plugin.getRoutes().forEach(function(route){definePluginRoute(self,route,plugin)}),"skin"===plugin.type?resolve(plugin):loadStrings(plugin,globalize).then(function(){resolve(plugin)},reject)})})},PluginManager.prototype.register=function(obj){this.pluginsList.push(obj),events.trigger(this,"registered",[obj])},PluginManager.prototype.ofType=function(type){return this.pluginsList.filter(function(o){return o.type===type})},PluginManager.prototype.plugins=function(){return this.pluginsList},PluginManager.prototype.mapRoute=function(plugin,route){return"string"==typeof plugin&&(plugin=this.pluginsList.filter(function(p){return(p.id||p.packageName)===plugin})[0]),route=route.path||route,0===route.toLowerCase().indexOf("http")?route:"/plugins/"+plugin.id+"/"+route},PluginManager.prototype.mapPath=function(plugin,path,addCacheParam){"string"==typeof plugin&&(plugin=this.pluginsList.filter(function(p){return(p.id||p.packageName)===plugin})[0]);var url=plugin.baseUrl+"/"+path;return addCacheParam&&(url+=url.indexOf("?")===-1?"?":"&",url+="v="+cacheParam),url};var instance=new PluginManager;return window.Emby=window.Emby||{},window.Emby.PluginManager=instance,instance});

File diff suppressed because one or more lines are too long