mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove references to Orsay and Chromecast in browserDeviceProfile
This commit is contained in:
parent
7b0fbc7c7a
commit
49491d013e
1 changed files with 37 additions and 116 deletions
|
@ -6,18 +6,10 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function canPlayH265(videoTestElement, options) {
|
function canPlayH265(videoTestElement, options) {
|
||||||
if (browser.tizen || browser.orsay || browser.xboxOne || browser.web0s || options.supportsHevc) {
|
if (browser.tizen || browser.xboxOne || browser.web0s || options.supportsHevc) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var userAgent = navigator.userAgent.toLowerCase();
|
|
||||||
if (browser.chromecast) {
|
|
||||||
var isChromecastUltra = userAgent.indexOf('aarch64') !== -1;
|
|
||||||
if (isChromecastUltra) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (browser.ps4) {
|
if (browser.ps4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +23,7 @@ define(['browser'], function (browser) {
|
||||||
|
|
||||||
var _supportsTextTracks;
|
var _supportsTextTracks;
|
||||||
function supportsTextTracks() {
|
function supportsTextTracks() {
|
||||||
if (browser.tizen || browser.orsay) {
|
if (browser.tizen) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +45,7 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function canPlayNativeHls() {
|
function canPlayNativeHls() {
|
||||||
if (browser.tizen || browser.orsay) {
|
if (browser.tizen) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +64,7 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function supportsAc3(videoTestElement) {
|
function supportsAc3(videoTestElement) {
|
||||||
if (browser.edgeUwp || browser.tizen || browser.orsay || browser.web0s) {
|
if (browser.edgeUwp || browser.tizen || browser.web0s) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +72,7 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function supportsEac3(videoTestElement) {
|
function supportsEac3(videoTestElement) {
|
||||||
if (browser.tizen || browser.orsay || browser.web0s) {
|
if (browser.tizen || browser.web0s) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +80,7 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function supportsAc3InHls(videoTestElement) {
|
function supportsAc3InHls(videoTestElement) {
|
||||||
if (browser.tizen || browser.orsay || browser.web0s) {
|
if (browser.tizen || browser.web0s) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,11 +96,11 @@ define(['browser'], function (browser) {
|
||||||
var typeString;
|
var typeString;
|
||||||
|
|
||||||
if (format === 'flac') {
|
if (format === 'flac') {
|
||||||
if (browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp) {
|
if (browser.tizen || browser.web0s || browser.edgeUwp) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (format === 'wma') {
|
} else if (format === 'wma') {
|
||||||
if (browser.tizen || browser.orsay || browser.edgeUwp) {
|
if (browser.tizen || browser.edgeUwp) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (format === 'asf') {
|
} else if (format === 'asf') {
|
||||||
|
@ -143,7 +135,7 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function testCanPlayMkv(videoTestElement) {
|
function testCanPlayMkv(videoTestElement) {
|
||||||
if (browser.tizen || browser.orsay || browser.web0s) {
|
if (browser.tizen || browser.web0s) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,23 +144,6 @@ define(['browser'], function (browser) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unfortunately there's no real way to detect mkv support
|
|
||||||
if (browser.chrome) {
|
|
||||||
// Not supported on opera tv
|
|
||||||
if (browser.operaTv) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var userAgent = navigator.userAgent.toLowerCase();
|
|
||||||
|
|
||||||
// Filter out browsers based on chromium that don't support mkv
|
|
||||||
if (userAgent.indexOf('vivaldi') !== -1 || userAgent.indexOf('opera') !== -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (browser.edgeUwp) {
|
if (browser.edgeUwp) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -177,15 +152,15 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function testCanPlayTs() {
|
function testCanPlayTs() {
|
||||||
return browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
return browser.tizen || browser.web0s || browser.edgeUwp;
|
||||||
}
|
}
|
||||||
|
|
||||||
function supportsMpeg2Video() {
|
function supportsMpeg2Video() {
|
||||||
return browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
return browser.tizen || browser.web0s || browser.edgeUwp;
|
||||||
}
|
}
|
||||||
|
|
||||||
function supportsVc1() {
|
function supportsVc1() {
|
||||||
return browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
return browser.tizen || browser.web0s || browser.edgeUwp;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDirectPlayProfileForVideoContainer(container, videoAudioCodecs, videoTestElement, options) {
|
function getDirectPlayProfileForVideoContainer(container, videoAudioCodecs, videoTestElement, options) {
|
||||||
|
@ -195,11 +170,11 @@ define(['browser'], function (browser) {
|
||||||
|
|
||||||
switch (container) {
|
switch (container) {
|
||||||
case 'asf':
|
case 'asf':
|
||||||
supported = browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
supported = browser.tizen || browser.web0s || browser.edgeUwp;
|
||||||
videoAudioCodecs = [];
|
videoAudioCodecs = [];
|
||||||
break;
|
break;
|
||||||
case 'avi':
|
case 'avi':
|
||||||
supported = browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
supported = browser.tizen || browser.web0s || browser.edgeUwp;
|
||||||
// New Samsung TV don't support XviD/DivX
|
// New Samsung TV don't support XviD/DivX
|
||||||
// Explicitly add supported codecs to make other codecs be transcoded
|
// Explicitly add supported codecs to make other codecs be transcoded
|
||||||
if (browser.tizenVersion >= 4) {
|
if (browser.tizenVersion >= 4) {
|
||||||
|
@ -212,24 +187,24 @@ define(['browser'], function (browser) {
|
||||||
break;
|
break;
|
||||||
case 'mpg':
|
case 'mpg':
|
||||||
case 'mpeg':
|
case 'mpeg':
|
||||||
supported = browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
supported = browser.tizen || browser.web0s || browser.edgeUwp;
|
||||||
break;
|
break;
|
||||||
case 'flv':
|
case 'flv':
|
||||||
supported = browser.tizen || browser.orsay;
|
supported = browser.tizen;
|
||||||
break;
|
break;
|
||||||
case '3gp':
|
case '3gp':
|
||||||
case 'mts':
|
case 'mts':
|
||||||
case 'trp':
|
case 'trp':
|
||||||
case 'vob':
|
case 'vob':
|
||||||
case 'vro':
|
case 'vro':
|
||||||
supported = browser.tizen || browser.orsay;
|
supported = browser.tizen;
|
||||||
break;
|
break;
|
||||||
case 'mov':
|
case 'mov':
|
||||||
supported = browser.tizen || browser.orsay || browser.web0s || browser.chrome || browser.edgeUwp;
|
supported = browser.tizen || browser.web0s || browser.chrome || browser.edgeUwp;
|
||||||
videoCodecs.push('h264');
|
videoCodecs.push('h264');
|
||||||
break;
|
break;
|
||||||
case 'm2ts':
|
case 'm2ts':
|
||||||
supported = browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
supported = browser.tizen || browser.web0s || browser.edgeUwp;
|
||||||
videoCodecs.push('h264');
|
videoCodecs.push('h264');
|
||||||
if (supportsVc1()) {
|
if (supportsVc1()) {
|
||||||
videoCodecs.push('vc1');
|
videoCodecs.push('vc1');
|
||||||
|
@ -239,7 +214,7 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'wmv':
|
case 'wmv':
|
||||||
supported = browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
supported = browser.tizen || browser.web0s || browser.edgeUwp;
|
||||||
videoAudioCodecs = [];
|
videoAudioCodecs = [];
|
||||||
break;
|
break;
|
||||||
case 'ts':
|
case 'ts':
|
||||||
|
@ -274,21 +249,6 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGlobalMaxVideoBitrate() {
|
function getGlobalMaxVideoBitrate() {
|
||||||
var userAgent = navigator.userAgent.toLowerCase();
|
|
||||||
if (browser.chromecast) {
|
|
||||||
var isChromecastUltra = userAgent.indexOf('aarch64') !== -1;
|
|
||||||
if (isChromecastUltra) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is a hack to try and detect chromecast on vizio
|
|
||||||
if (self.screen && self.screen.width >= 3800) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 30000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
var isTizenFhd = false;
|
var isTizenFhd = false;
|
||||||
if (browser.tizen) {
|
if (browser.tizen) {
|
||||||
try {
|
try {
|
||||||
|
@ -338,7 +298,7 @@ define(['browser'], function (browser) {
|
||||||
|| videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp3"').replace(/no/, '');
|
|| videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp3"').replace(/no/, '');
|
||||||
|
|
||||||
// Not sure how to test for this
|
// Not sure how to test for this
|
||||||
var supportsMp2VideoAudio = browser.edgeUwp || browser.tizen || browser.orsay || browser.web0s;
|
var supportsMp2VideoAudio = browser.edgeUwp || browser.tizen || browser.web0s;
|
||||||
|
|
||||||
var maxVideoWidth = browser.xboxOne ?
|
var maxVideoWidth = browser.xboxOne ?
|
||||||
(self.screen ? self.screen.width : null) :
|
(self.screen ? self.screen.width : null) :
|
||||||
|
@ -350,11 +310,6 @@ define(['browser'], function (browser) {
|
||||||
|
|
||||||
var canPlayAacVideoAudio = videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.2"').replace(/no/, '');
|
var canPlayAacVideoAudio = videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.2"').replace(/no/, '');
|
||||||
|
|
||||||
if (canPlayAacVideoAudio && browser.chromecast && physicalAudioChannels <= 2) {
|
|
||||||
// prioritize this first
|
|
||||||
videoAudioCodecs.push('aac');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only put mp3 first if mkv support is there
|
// Only put mp3 first if mkv support is there
|
||||||
// Otherwise with HLS and mp3 audio we're seeing some browsers
|
// Otherwise with HLS and mp3 audio we're seeing some browsers
|
||||||
// safari is lying
|
// safari is lying
|
||||||
|
@ -377,11 +332,6 @@ define(['browser'], function (browser) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canPlayAacVideoAudio && browser.chromecast && videoAudioCodecs.indexOf('aac') === -1) {
|
|
||||||
// prioritize this first
|
|
||||||
videoAudioCodecs.push('aac');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportsMp3VideoAudio) {
|
if (supportsMp3VideoAudio) {
|
||||||
videoAudioCodecs.push('mp3');
|
videoAudioCodecs.push('mp3');
|
||||||
|
|
||||||
|
@ -416,7 +366,7 @@ define(['browser'], function (browser) {
|
||||||
videoAudioCodecs.push('mp2');
|
videoAudioCodecs.push('mp2');
|
||||||
}
|
}
|
||||||
|
|
||||||
var supportsDts = browser.tizen || browser.orsay || browser.web0s || options.supportsDts;
|
var supportsDts = browser.tizen || browser.web0s || options.supportsDts;
|
||||||
|
|
||||||
// DTS audio not supported in 2018 models (Tizen 4.0)
|
// DTS audio not supported in 2018 models (Tizen 4.0)
|
||||||
if (browser.tizenVersion >= 4) {
|
if (browser.tizenVersion >= 4) {
|
||||||
|
@ -428,7 +378,7 @@ define(['browser'], function (browser) {
|
||||||
videoAudioCodecs.push('dts');
|
videoAudioCodecs.push('dts');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.tizen || browser.orsay || browser.web0s) {
|
if (browser.tizen || browser.web0s) {
|
||||||
videoAudioCodecs.push('pcm_s16le');
|
videoAudioCodecs.push('pcm_s16le');
|
||||||
videoAudioCodecs.push('pcm_s24le');
|
videoAudioCodecs.push('pcm_s24le');
|
||||||
}
|
}
|
||||||
|
@ -437,7 +387,7 @@ define(['browser'], function (browser) {
|
||||||
videoAudioCodecs.push('truehd');
|
videoAudioCodecs.push('truehd');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.tizen || browser.orsay) {
|
if (browser.tizen) {
|
||||||
videoAudioCodecs.push('aac_latm');
|
videoAudioCodecs.push('aac_latm');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,7 +435,7 @@ define(['browser'], function (browser) {
|
||||||
mp4VideoCodecs.push('vc1');
|
mp4VideoCodecs.push('vc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.tizen || browser.orsay) {
|
if (browser.tizen) {
|
||||||
mp4VideoCodecs.push('msmpeg4v2');
|
mp4VideoCodecs.push('msmpeg4v2');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -497,7 +447,7 @@ define(['browser'], function (browser) {
|
||||||
mp4VideoCodecs.push('vp9');
|
mp4VideoCodecs.push('vp9');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canPlayVp8 || browser.tizen || browser.orsay) {
|
if (canPlayVp8 || browser.tizen) {
|
||||||
videoAudioCodecs.push('vorbis');
|
videoAudioCodecs.push('vorbis');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,7 +579,7 @@ define(['browser'], function (browser) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (canPlayMkv && !browser.tizen && !browser.orsay && options.enableMkvProgressive !== false) {
|
if (canPlayMkv && !browser.tizen && options.enableMkvProgressive !== false) {
|
||||||
profile.TranscodingProfiles.push({
|
profile.TranscodingProfiles.push({
|
||||||
Container: 'mkv',
|
Container: 'mkv',
|
||||||
Type: 'Video',
|
Type: 'Video',
|
||||||
|
@ -694,7 +644,7 @@ define(['browser'], function (browser) {
|
||||||
|
|
||||||
profile.CodecProfiles = [];
|
profile.CodecProfiles = [];
|
||||||
|
|
||||||
var supportsSecondaryAudio = browser.tizen || browser.orsay || videoTestElement.audioTracks;
|
var supportsSecondaryAudio = browser.tizen || videoTestElement.audioTracks;
|
||||||
|
|
||||||
var aacCodecProfileConditions = [];
|
var aacCodecProfileConditions = [];
|
||||||
|
|
||||||
|
@ -717,15 +667,6 @@ define(['browser'], function (browser) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.chromecast) {
|
|
||||||
aacCodecProfileConditions.push({
|
|
||||||
Condition: 'LessThanEqual',
|
|
||||||
Property: 'AudioChannels',
|
|
||||||
Value: '2',
|
|
||||||
IsRequired: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aacCodecProfileConditions.length) {
|
if (aacCodecProfileConditions.length) {
|
||||||
profile.CodecProfiles.push({
|
profile.CodecProfiles.push({
|
||||||
Type: 'VideoAudio',
|
Type: 'VideoAudio',
|
||||||
|
@ -751,7 +692,7 @@ define(['browser'], function (browser) {
|
||||||
var maxH264Level = 42;
|
var maxH264Level = 42;
|
||||||
var h264Profiles = 'high|main|baseline|constrained baseline';
|
var h264Profiles = 'high|main|baseline|constrained baseline';
|
||||||
|
|
||||||
if (browser.tizen || browser.orsay || browser.web0s ||
|
if (browser.tizen || browser.web0s ||
|
||||||
videoTestElement.canPlayType('video/mp4; codecs="avc1.640833"').replace(/no/, '')) {
|
videoTestElement.canPlayType('video/mp4; codecs="avc1.640833"').replace(/no/, '')) {
|
||||||
maxH264Level = 51;
|
maxH264Level = 51;
|
||||||
}
|
}
|
||||||
|
@ -761,7 +702,7 @@ define(['browser'], function (browser) {
|
||||||
maxH264Level = 52;
|
maxH264Level = 52;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.tizen || browser.orsay ||
|
if (browser.tizen ||
|
||||||
videoTestElement.canPlayType('video/mp4; codecs="avc1.6e0033"').replace(/no/, '')) {
|
videoTestElement.canPlayType('video/mp4; codecs="avc1.6e0033"').replace(/no/, '')) {
|
||||||
|
|
||||||
// These tests are passing in safari, but playback is failing
|
// These tests are passing in safari, but playback is failing
|
||||||
|
@ -795,20 +736,13 @@ define(['browser'], function (browser) {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!browser.edgeUwp && !browser.tizen && !browser.orsay && !browser.web0s) {
|
if (!browser.edgeUwp && !browser.tizen && !browser.web0s) {
|
||||||
//profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({
|
profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({
|
||||||
// Condition: 'NotEquals',
|
Condition: 'NotEquals',
|
||||||
// Property: 'IsAVC',
|
Property: 'IsInterlaced',
|
||||||
// Value: 'false',
|
Value: 'true',
|
||||||
// IsRequired: false
|
IsRequired: false
|
||||||
//});
|
});
|
||||||
|
|
||||||
//profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({
|
|
||||||
// Condition: 'NotEquals',
|
|
||||||
// Property: 'IsInterlaced',
|
|
||||||
// Value: 'true',
|
|
||||||
// IsRequired: false
|
|
||||||
//});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxVideoWidth) {
|
if (maxVideoWidth) {
|
||||||
|
@ -859,19 +793,6 @@ define(['browser'], function (browser) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.chromecast) {
|
|
||||||
profile.CodecProfiles.push({
|
|
||||||
Type: 'Audio',
|
|
||||||
Codec: 'flac',
|
|
||||||
Conditions: [
|
|
||||||
{
|
|
||||||
Condition: 'LessThanEqual',
|
|
||||||
Property: 'AudioSampleRate',
|
|
||||||
Value: '96000'
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Subtitle profiles
|
// Subtitle profiles
|
||||||
// External vtt or burn in
|
// External vtt or burn in
|
||||||
profile.SubtitleProfiles = [];
|
profile.SubtitleProfiles = [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue