update components

This commit is contained in:
Luke Pulverenti 2016-06-25 16:18:23 -04:00
parent 4d618da015
commit 1fd4ea266c
7 changed files with 56 additions and 17 deletions

View File

@ -15,12 +15,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.4.56",
"_release": "1.4.56",
"version": "1.4.57",
"_release": "1.4.57",
"_resolution": {
"type": "version",
"tag": "1.4.56",
"commit": "2e223ca2b059e6af4bbf718d3bce601c714d608e"
"tag": "1.4.57",
"commit": "c0eea0e334d3c59e78193619463cc79913d62ffe"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.0",

View File

@ -49,7 +49,19 @@ define(['browser'], function (browser) {
var typeString;
if (format == 'opus') {
if (format == 'flac') {
if (browser.tizen) {
return true;
}
}
else if (format == 'wma') {
if (browser.tizen) {
return true;
}
}
else if (format == 'opus') {
typeString = 'audio/ogg; codecs="opus"';
if (document.createElement('audio').canPlayType(typeString).replace(/no/, '')) {
@ -258,7 +270,7 @@ define(['browser'], function (browser) {
profile.DirectPlayProfiles.push(i);
});
['opus', 'mp3', 'aac', 'flac', 'webma'].filter(canPlayAudioFormat).forEach(function (audioFormat) {
['opus', 'mp3', 'aac', 'flac', 'webma', 'wma'].filter(canPlayAudioFormat).forEach(function (audioFormat) {
profile.DirectPlayProfiles.push({
Container: audioFormat == 'webma' ? 'webma,webm' : audioFormat,

View File

@ -45,6 +45,14 @@
}
}
function enableAnimation() {
if (browser.tv) {
// too slow
return false;
}
return true;
}
EmbyButtonPrototype.attachedCallback = function () {
if (this.getAttribute('data-embybutton') == 'true') {
@ -57,12 +65,14 @@
this.classList.add('noflex');
}
this.addEventListener('keydown', onKeyDown);
if (browser.safari) {
this.addEventListener('click', animateButton);
} else {
this.addEventListener('mousedown', onMouseDown);
//this.addEventListener('touchstart', animateButton);
if (enableAnimation()) {
this.addEventListener('keydown', onKeyDown);
if (browser.safari) {
this.addEventListener('click', animateButton);
} else {
this.addEventListener('mousedown', onMouseDown);
//this.addEventListener('touchstart', animateButton);
}
}
};

View File

@ -1,7 +1,15 @@
define(['css!./emby-button', 'registerElement'], function () {
define(['browser', 'css!./emby-button', 'registerElement'], function (browser) {
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
function enableAnimation() {
if (browser.tv) {
// too slow
return false;
}
return true;
}
function animateButtonInternal(e, btn) {
var div = document.createElement('div');
@ -46,8 +54,10 @@
this.setAttribute('data-embybutton', 'true');
this.addEventListener('keydown', onKeyDown);
this.addEventListener('click', animateButton);
if (enableAnimation()) {
this.addEventListener('keydown', onKeyDown);
this.addEventListener('click', animateButton);
}
};
document.registerElement('paper-icon-button-light', {

View File

@ -8,6 +8,11 @@
return false;
}
// Doesn't seem to work at all
if (browser.tizen) {
return false;
}
// Take advantage of the native input methods
if (browser.tv) {
return true;
@ -120,13 +125,15 @@
inputId++;
}
this.removeEventListener('mousedown', onMouseDown);
this.removeEventListener('keydown', onKeyDown);
this.removeEventListener('focus', onFocus);
this.removeEventListener('blur', onBlur);
this.removeEventListener('mousedown', onMouseDown);
this.removeEventListener('keydown', onKeyDown);
this.addEventListener('mousedown', onMouseDown);
this.addEventListener('keydown', onKeyDown);
this.addEventListener('focus', onFocus);
this.addEventListener('blur', onBlur);
};