Skip to content

Commit

Permalink
fix(FEC-9362): IPad OS wasn't under touch devices (#413)
Browse files Browse the repository at this point in the history
add IPad OS as Mobile device and exclude IPad OS from ads UI.
  • Loading branch information
Yuvalke committed Sep 25, 2019
1 parent 31f2b1c commit c163869
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/shell/shell.js
Expand Up @@ -211,7 +211,8 @@ class Shell extends Component {
*/
componentDidMount() {
const {player, forceTouchUI} = this.props;
this.props.updateIsMobile(player.env.isTablet || player.env.isMobile || forceTouchUI);
const {isIPadOS, isTablet, isMobile} = player.env;
this.props.updateIsMobile(isIPadOS || isTablet || isMobile || forceTouchUI);
this._onWindowResize();
this.props.eventManager.listen(player, player.Event.RESIZE, () => this._onWindowResize());
this.props.eventManager.listen(player, player.Event.FIRST_PLAY, () => this._onWindowResize());
Expand Down
4 changes: 2 additions & 2 deletions src/ui-presets/ads.js
Expand Up @@ -96,15 +96,15 @@ function getAdsUiCustomization(): Object {
* @returns {boolean} - Whether the default ads ui should be shown or not.
*/
function useDefaultAdsUi(props: any, context: any): boolean {
const isMobile = props.state.shell.isMobile;
const isMobileUI = props.state.shell.isMobile && !context.player.env.isIPadOS;
let useStyledLinearAds = false;
try {
const adsRenderingSettings = context.player.config.plugins.ima.adsRenderingSettings;
useStyledLinearAds = adsRenderingSettings && adsRenderingSettings.useStyledLinearAds;
} catch (e) {
// Do nothing
}
return isMobile || useStyledLinearAds;
return isMobileUI || useStyledLinearAds;
}

/**
Expand Down

0 comments on commit c163869

Please sign in to comment.