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
13 changes: 11 additions & 2 deletions src/k-provider/ovp/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {

export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject> {
private _filterOptionsConfig: ProviderFilterOptionsObject = {redirectFromEntryId: true};
private _vrTag: string | null = null;
/**
* @constructor
* @param {ProviderOptionsObject} options - provider options
Expand Down Expand Up @@ -360,10 +361,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._vrTag) {
if (mediaEntry.metadata && typeof mediaEntry.metadata.tags === 'string' && mediaEntry.metadata.tags.split(',').map(tag => tag.trim().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.

use some instead of map, as one good tag is needed

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

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
public setVrTag(vrTag: string) {
this._vrTag = vrTag
}
}