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

update video osd

This commit is contained in:
Luke Pulverenti 2017-01-09 12:05:34 -05:00
parent 31b6fde452
commit 7b22758cec
4 changed files with 56 additions and 190 deletions

View file

@ -986,6 +986,15 @@
data = data || self.lastPlayerData; data = data || self.lastPlayerData;
self.lastPlayerData = data; self.lastPlayerData = data;
if (data && data.NowPlayingItem) {
if (!data.NowPlayingItem.ImageTags || !data.NowPlayingItem.ImageTags.Primary) {
if (data.NowPlayingItem.PrimaryImageTag) {
data.NowPlayingItem.ImageTags = data.NowPlayingItem.ImageTags || {};
data.NowPlayingItem.ImageTags.Primary = data.NowPlayingItem.PrimaryImageTag;
}
}
}
//console.log(JSON.stringify(data)); //console.log(JSON.stringify(data));
if (triggerStateChange) { if (triggerStateChange) {

View file

@ -490,6 +490,10 @@
function seriesImageUrl(item, options) { function seriesImageUrl(item, options) {
if (!item) {
throw new Error('item cannot be null!');
}
if (item.Type !== 'Episode') { if (item.Type !== 'Episode') {
return null; return null;
} }
@ -528,6 +532,10 @@
function imageUrl(item, options) { function imageUrl(item, options) {
if (!item) {
throw new Error('item cannot be null!');
}
options = options || {}; options = options || {};
options.type = options.type || "Primary"; options.type = options.type || "Primary";
@ -549,7 +557,9 @@
var currentImgUrl; var currentImgUrl;
function updateNowPlayingInfo(state) { function updateNowPlayingInfo(state) {
nowPlayingTextElement.innerHTML = nowPlayingHelper.getNowPlayingNames(state.NowPlayingItem).map(function (nowPlayingName) { var nowPlayingItem = state.NowPlayingItem;
nowPlayingTextElement.innerHTML = nowPlayingItem ? nowPlayingHelper.getNowPlayingNames(nowPlayingItem).map(function (nowPlayingName) {
if (nowPlayingName.item) { if (nowPlayingName.item) {
return '<div>' + getTextActionButton(nowPlayingName.item, nowPlayingName.text) + '</div>'; return '<div>' + getTextActionButton(nowPlayingName.item, nowPlayingName.text) + '</div>';
@ -557,18 +567,17 @@
return '<div>' + nowPlayingName.text + '</div>'; return '<div>' + nowPlayingName.text + '</div>';
}).join(''); }).join('') : '';
var imgHeight = 70; var imgHeight = 70;
var nowPlayingItem = state.NowPlayingItem;
var url = seriesImageUrl(nowPlayingItem, { var url = nowPlayingItem ? (seriesImageUrl(nowPlayingItem, {
height: imgHeight height: imgHeight
}) || imageUrl(nowPlayingItem, { }) || imageUrl(nowPlayingItem, {
height: imgHeight height: imgHeight
}); })) : null;
if (url == currentImgUrl) { if (url === currentImgUrl) {
return; return;
} }

View file

@ -655,173 +655,6 @@ var Dashboard = {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
function updateDeviceProfileForAndroid(profile) {
// Just here as an easy escape out, if ever needed
var enableVlcVideo = true;
var enableVlcAudio = window.VlcAudio;
if (enableVlcVideo) {
profile.DirectPlayProfiles.push({
Container: "m4v,3gp,ts,mpegts,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm,wtv",
Type: 'Video',
AudioCodec: 'aac,aac_latm,mp2,mp3,ac3,wma,dca,dts,pcm,PCM_S16LE,PCM_S24LE,opus,flac'
});
profile.CodecProfiles = profile.CodecProfiles.filter(function (i) {
return i.Type == 'Audio';
});
profile.SubtitleProfiles = [];
profile.SubtitleProfiles.push({
Format: 'srt',
Method: 'External'
});
profile.SubtitleProfiles.push({
Format: 'ssa',
Method: 'External'
});
profile.SubtitleProfiles.push({
Format: 'ass',
Method: 'External'
});
profile.SubtitleProfiles.push({
Format: 'srt',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'subrip',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'ass',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'ssa',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'dvb_teletext',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'dvb_subtitle',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'dvbsub',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'pgs',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'pgssub',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'dvdsub',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'vtt',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'sub',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'idx',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'smi',
Method: 'Embed'
});
profile.CodecProfiles.push({
Type: 'Video',
Container: 'avi',
Conditions: [
{
Condition: 'NotEqual',
Property: 'CodecTag',
Value: 'xvid'
}
]
});
profile.CodecProfiles.push({
Type: 'Video',
Codec: 'h264',
Conditions: [
{
Condition: 'EqualsAny',
Property: 'VideoProfile',
Value: 'high|main|baseline|constrained baseline'
},
{
Condition: 'LessThanEqual',
Property: 'VideoLevel',
Value: '41'
}]
});
//profile.TranscodingProfiles.filter(function (p) {
// return p.Type == 'Video' && p.Container == 'mkv';
//}).forEach(function (p) {
// p.Container = 'ts';
//});
profile.TranscodingProfiles.filter(function (p) {
return p.Type == 'Video' && p.CopyTimestamps == true;
}).forEach(function (p) {
// Vlc doesn't seem to handle this well
p.CopyTimestamps = false;
});
profile.TranscodingProfiles.filter(function (p) {
return p.Type == 'Video' && p.VideoCodec == 'h264';
}).forEach(function (p) {
p.AudioCodec += ',ac3';
});
}
if (enableVlcAudio) {
profile.DirectPlayProfiles.push({
Container: "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus,flac,m4a",
Type: 'Audio'
});
profile.CodecProfiles = profile.CodecProfiles.filter(function (i) {
return i.Type != 'Audio';
});
profile.CodecProfiles.push({
Type: 'Audio',
Conditions: [{
Condition: 'LessThanEqual',
Property: 'AudioChannels',
Value: '2'
}]
});
}
}
require(['browserdeviceprofile', 'qualityoptions', 'appSettings'], function (profileBuilder, qualityoptions, appSettings) { require(['browserdeviceprofile', 'qualityoptions', 'appSettings'], function (profileBuilder, qualityoptions, appSettings) {
var profile = profileBuilder(Object.assign(profileOptions || {}, { var profile = profileBuilder(Object.assign(profileOptions || {}, {
@ -847,10 +680,6 @@ var Dashboard = {
})[0].maxHeight; })[0].maxHeight;
} }
if (AppInfo.isNativeApp && browserInfo.android) {
updateDeviceProfileForAndroid(profile);
}
profile.MaxStreamingBitrate = bitrateSetting; profile.MaxStreamingBitrate = bitrateSetting;
profile.MaxStaticMusicBitrate = appSettings.maxStaticMusicBitrate(); profile.MaxStaticMusicBitrate = appSettings.maxStaticMusicBitrate();
@ -1628,11 +1457,6 @@ var AppInfo = {};
define("nativedirectorychooser", ["cordova/nativedirectorychooser"]); define("nativedirectorychooser", ["cordova/nativedirectorychooser"]);
} }
if (Dashboard.isRunningInCordova() && browserInfo.android) {
window.VlcAudio = true;
}
if (Dashboard.isRunningInCordova() && browserInfo.android) { if (Dashboard.isRunningInCordova() && browserInfo.android) {
define("localsync", ["cordova/localsync"], returnFirstDependency); define("localsync", ["cordova/localsync"], returnFirstDependency);
} }
@ -2551,7 +2375,21 @@ var AppInfo = {};
//'plugins/playbackvalidation/plugin' //'plugins/playbackvalidation/plugin'
]; ];
if (Dashboard.isRunningInCordova() && browser.safari) { if (Dashboard.isRunningInCordova() && browser.android) {
// use the html audio player if flac is supported
if (document.createElement('audio').canPlayType('audio/flac').replace(/no/, '') &&
document.createElement('audio').canPlayType('audio/ogg; codecs="opus"').replace(/no/, '')) {
list.push('bower_components/emby-webcomponents/htmlaudioplayer/plugin');
} else {
// use vlc player
list.push('cordova/vlcplayer');
}
} else if (Dashboard.isRunningInCordova() && browser.safari) {
list.push('cordova/audioplayer'); list.push('cordova/audioplayer');
} else { } else {
list.push('bower_components/emby-webcomponents/htmlaudioplayer/plugin'); list.push('bower_components/emby-webcomponents/htmlaudioplayer/plugin');

View file

@ -400,19 +400,32 @@
events.on(playbackManager, 'playerchange', onPlayerChange); events.on(playbackManager, 'playerchange', onPlayerChange);
bindToPlayer(playbackManager.getCurrentPlayer()); bindToPlayer(playbackManager.getCurrentPlayer());
document.addEventListener('mousemove', onMouseMove); dom.addEventListener(document, 'mousemove', onMouseMove, {
passive: true
});
document.body.classList.add('autoScrollY'); document.body.classList.add('autoScrollY');
showOsd(); showOsd();
inputManager.on(window, onInputCommand); inputManager.on(window, onInputCommand);
dom.addEventListener(window, 'keydown', onWindowKeyDown, {
passive: true
});
}); });
view.addEventListener('viewbeforehide', function () { view.addEventListener('viewbeforehide', function () {
dom.removeEventListener(window, 'keydown', onWindowKeyDown, {
passive: true
});
stopHideTimer(); stopHideTimer();
getHeaderElement().classList.remove('osdHeader'); getHeaderElement().classList.remove('osdHeader');
getHeaderElement().classList.remove('osdHeader-hidden'); getHeaderElement().classList.remove('osdHeader-hidden');
document.removeEventListener('mousemove', onMouseMove); dom.removeEventListener(document, 'mousemove', onMouseMove, {
passive: true
});
document.body.classList.remove('autoScrollY'); document.body.classList.remove('autoScrollY');
inputManager.off(window, onInputCommand); inputManager.off(window, onInputCommand);
@ -904,15 +917,12 @@
getHeaderElement().classList.remove('hide'); getHeaderElement().classList.remove('hide');
}); });
dom.addEventListener(window, 'keydown', function (e) { function onWindowKeyDown(e) {
if (e.keyCode === 32 && !isOsdOpen()) { if (e.keyCode === 32 && !isOsdOpen()) {
playbackManager.playPause(currentPlayer); playbackManager.playPause(currentPlayer);
showOsd(); showOsd();
} }
}, { }
passive: true
});
view.querySelector('.pageContainer').addEventListener('click', function () { view.querySelector('.pageContainer').addEventListener('click', function () {