Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUP-46065: Player shows VR button based on "360" (or variations) tag #255

Closed
wants to merge 6 commits into from
16 changes: 13 additions & 3 deletions src/k-provider/ovp/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import {

export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject> {
private _filterOptionsConfig: ProviderFilterOptionsObject = {redirectFromEntryId: true};
private _vrPluginIsOn = false
private _vrTag: string | null = null;
/**
* @constructor
* @param {ProviderOptionsObject} options - provider options
Expand Down Expand Up @@ -360,10 +362,18 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
if (mediaEntry.sources.captions) {
sourcesObject.captions = mediaEntry.sources.captions;
}
if (mediaEntry.metadata && typeof mediaEntry.metadata.tags === 'string' && mediaEntry.metadata.tags.split(', ').includes('360')) {
sourcesObject.vr = {};
}

if(this._vrPluginIsOn && this._vrTag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this._vrPluginIsOn is not needed

if (mediaEntry.metadata && typeof mediaEntry.metadata.tags === 'string' && mediaEntry.metadata.tags.split(', ').includes(this._vrTag)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split by "," and trim the value before checking includes

sourcesObject.vr = {};
}
Object.assign(sourcesObject.metadata, mediaEntry.metadata);
return sourcesObject;
}

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
public _updatePlayerVrPluginIsOn(vrTag: string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setVr(..)

this._vrTag = vrTag
this._vrPluginIsOn = true
}
}