Skip to content

Commit

Permalink
Merge pull request jellyfin#1660 from nyanmisaka/edge-chromium
Browse files Browse the repository at this point in the history
Fix mkv directplay on Edge chromium
  • Loading branch information
joshuaboniface committed Jul 27, 2020
2 parents 58198df + 7e5be8e commit 0408ff0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/assets/img/devices/edgechromium.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/components/apphost.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
deviceName = 'Sony PS4';
} else if (browser.chrome) {
deviceName = 'Chrome';
} else if (browser.edgeChromium) {
deviceName = 'Edge Chromium';
} else if (browser.edge) {
deviceName = 'Edge';
} else if (browser.firefox) {
Expand Down Expand Up @@ -291,7 +293,7 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
features.push('fileinput');
}

if (browser.chrome) {
if (browser.chrome || browser.edgeChromium) {
features.push('chromecast');
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/playback/playerSelectionMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function show(button) {

// Unfortunately we can't allow the url to change or chromecast will throw a security error
// Might be able to solve this in the future by moving the dialogs to hashbangs
if (!(!browser.chrome || appHost.supports('castmenuhashchange'))) {
if (!(!browser.chrome && !browser.edgeChromium || appHost.supports('castmenuhashchange'))) {
menuOptions.enableHistory = false;
}

Expand Down
9 changes: 7 additions & 2 deletions src/scripts/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ define([], function () {
var uaMatch = function (ua) {
ua = ua.toLowerCase();

var match = /(edge)[ \/]([\w.]+)/.exec(ua) ||
var match = /(edg)[ \/]([\w.]+)/.exec(ua) ||
/(edga)[ \/]([\w.]+)/.exec(ua) ||
/(edgios)[ \/]([\w.]+)/.exec(ua) ||
/(edge)[ \/]([\w.]+)/.exec(ua) ||
/(opera)[ \/]([\w.]+)/.exec(ua) ||
/(opr)[ \/]([\w.]+)/.exec(ua) ||
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
Expand Down Expand Up @@ -190,7 +193,9 @@ define([], function () {
browser[matched.platform] = true;
}

if (!browser.chrome && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf('webkit') !== -1) {
browser.edgeChromium = browser.edg || browser.edga || browser.edgios;

if (!browser.chrome && !browser.edgeChromium && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf('webkit') !== -1) {
browser.safari = true;
}

Expand Down
6 changes: 5 additions & 1 deletion src/scripts/browserDeviceProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ define(['browser'], function (browser) {
return true;
}

if (browser.edgeChromium && browser.windows) {
return true;
}

if (browser.edgeUwp) {
return true;
}
Expand Down Expand Up @@ -210,7 +214,7 @@ define(['browser'], function (browser) {
supported = browser.tizen;
break;
case 'mov':
supported = browser.tizen || browser.web0s || browser.chrome || browser.edgeUwp;
supported = browser.tizen || browser.web0s || browser.chrome || browser.edgeChromium || browser.edgeUwp;
videoCodecs.push('h264');
break;
case 'm2ts':
Expand Down
5 changes: 5 additions & 0 deletions src/scripts/imagehelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
case 'Safari iPad':
case 'Safari iPhone':
return baseUrl + 'safari.svg';
case 'Edge Chromium':
case 'Edge Chromium Android':
case 'Edge Chromium iPad':
case 'Edge Chromium iPhone':
return baseUrl + 'edgechromium.svg';
case 'Edge':
return baseUrl + 'edge.svg';
case 'Internet Explorer':
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ function initClient() {
if (appHost.supports('remotecontrol')) {
list.push('plugins/sessionPlayer/plugin');

if (browser.chrome || browser.opera) {
if (browser.chrome || browser.edgeChromium || browser.opera) {
list.push('plugins/chromecastPlayer/plugin');
}
}
Expand Down

0 comments on commit 0408ff0

Please sign in to comment.