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

fix(FEC-8382): stereo icon displayed on iPhone, even if VR plugin disabled #144

Merged
merged 1 commit into from
Jul 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/common/ui-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ class UIWrapper {
}

resetErrorConfig(mediaInfo: ProviderMediaInfoObject): void {
if (this._disabled) return;
this._setErrorPresetConfig(mediaInfo);
this._resetErrorState();
}

_setErrorPresetConfig(mediaInfo: ProviderMediaInfoObject): void {
if (this._disabled) return;
this.setConfig({mediaInfo: mediaInfo}, 'error');
}

_resetErrorState(): void {
if (this._disabled) return;
this.setConfig({hasError: false}, 'engine');
}

Expand All @@ -50,8 +49,8 @@ class UIWrapper {
this.setConfig(Utils.Object.mergeDeep({}, previewThumbnailConfig, seekbarConfig), 'seekbar');
}

_handleVr(config: ?PKPluginsConfigObject): void {
if (config) {
_handleVr(config: PKPluginsConfigObject = {}): void {
if (config.vr && !config.vr.disable) {
Copy link
Contributor Author

@yairans yairans Jul 5, 2018

Choose a reason for hiding this comment

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

Actually, I would like to be sure the plugin is active (maybe its bundle non exist at all?)
But this info is unavailable in kalturaPlayer yet.
That's means, if vr plugin configured and not disabled, the vr button will display in the control bar even the plugin is inactive.

this._setFullscreenConfig();
this._setStereoConfig(config.vr)
}
Expand All @@ -62,7 +61,7 @@ class UIWrapper {
this.setConfig(Utils.Object.mergeDeep({}, {inBrowserFullscreenForIOS: true}, fullscreenConfig), 'fullscreen');
}

_setStereoConfig(vrConfig: Object = {}): void {
_setStereoConfig(vrConfig: Object): void {
if (vrConfig.toggleStereo || (Env.device.type && vrConfig.toggleStereo !== false)) {
// enable stereo mode by default for mobile device
this.setConfig(Utils.Object.mergeDeep({}, {vrStereoMode: !!(vrConfig.startInStereo)}), 'vrStereo');
Expand Down