Skip to content

Commit

Permalink
fix(FEC-8026): external OTT VOD/Live media doesn't works on IE 11 (#98)
Browse files Browse the repository at this point in the history
Change logic to redirect only when configured.
  • Loading branch information
Dan Ziv authored Mar 14, 2018
1 parent b91423a commit 17238bf
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/common/utils/external-stream-redirect-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import {Env, Utils} from 'playkit-js'
import {Utils} from 'playkit-js'

/**
* JSONP handler function, returns the direct manifest uri.
Expand All @@ -25,19 +25,8 @@ function getDirectManifestUri(data: Object, uri: string): string {
}

/**
* Whether we should use our JSONP http plugin.
* @returns {boolean} - Should use external stream requests redirect on manifests.
*/
function shouldUseExternalStreamRedirect(): boolean {
const affectedBrowsers = ['IE', 'Edge'];
const affectedVendors = ['panasonic'];
return (affectedBrowsers.includes(Env.browser.name) ||
(Env.device && affectedVendors.includes(Env.device.vendor)));
}

/**
* Add JSONP configuration to the general config.
* @param {Object} config - Configuration relevant to JSONP.
* Add external stream redirect configuration to the general config.
* @param {Object} config - Player config.
* @returns {void}
*/
function configureExternalStreamRedirect(config: Object): void {
Expand All @@ -50,11 +39,10 @@ function configureExternalStreamRedirect(config: Object): void {
});
sourceOptions = config.sources.options;
}
if (typeof sourceOptions.forceRedirectExternalStreams !== "boolean") {
sourceOptions.forceRedirectExternalStreams = shouldUseExternalStreamRedirect();
}
if (typeof sourceOptions.redirectExternalStreamsHandler !== "function") {
sourceOptions.redirectExternalStreamsHandler = getDirectManifestUri;
if (sourceOptions.forceRedirectExternalStreams) {
if (typeof sourceOptions.redirectExternalStreamsHandler !== "function") {
sourceOptions.redirectExternalStreamsHandler = getDirectManifestUri;
}
}
}

Expand Down

0 comments on commit 17238bf

Please sign in to comment.