Skip to content

Commit

Permalink
fix(FEC-7180): fullscreen element change fix (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dvir Hazout authored and Dan Ziv committed Oct 2, 2017
1 parent 97227fe commit aa4e090
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/components/fullscreen/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FullscreenControl extends BaseComponent {
* @memberof FullscreenControl
*/
constructor(obj: Object) {
super({name: 'Fullscreen', player: obj.player});
super({name: 'Fullscreen', player: obj.player, config: obj.config});
}

/**
Expand Down Expand Up @@ -102,7 +102,11 @@ class FullscreenControl extends BaseComponent {
this.player.getView().getElementsByTagName('video')[0].webkitEnterFullscreen();
}
else {
this.requestFullscreen(this.player.getView().parentElement);
let elementToFullscreen = document.getElementById(this.config.targetId);

if (elementToFullscreen) {
this.requestFullscreen(elementToFullscreen);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui-presets/ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function adsUI(props: any): React$Element<any> {
</div>
<div className='right-controls'>
<VolumeControl player={props.player}/>
<FullscreenControl player={props.player}/>
<FullscreenControl player={props.player} config={props.config}/>
</div>
</BottomBar>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/ui-presets/playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function playbackUI(props: any): React$Element<any> {
<VolumeControl player={props.player} />
<LanguageControl player={props.player} />
<SettingsControl player={props.player} />
<FullscreenControl player={props.player} />
<FullscreenControl player={props.player} config={props.config} />
</div>
</BottomBar>
</div>
Expand Down

0 comments on commit aa4e090

Please sign in to comment.