Skip to content

Commit

Permalink
Add check for provider before calling a function (#3117)
Browse files Browse the repository at this point in the history
* Add check for provider before calling a function

JW8-2318
  • Loading branch information
pajong committed Oct 12, 2018
1 parent d8ca25f commit c6da3a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,12 @@ function View(_api, _model) {
_toggleDOMFullscreen(_playerElement, state);
} else {
// Request media element fullscreen (iOS)
const provider = model.getVideo();
provider.setFullscreen(state);
const instream = model.get('instream');
const instreamProvider = instream ? instream.provider : null;
const provider = model.getVideo() || instreamProvider;
if (provider && provider.setFullscreen) {
provider.setFullscreen(state);
}
}
};

Expand Down

0 comments on commit c6da3a4

Please sign in to comment.