snipe changes for ios
This commit is contained in:
parent
a77e59cb53
commit
d5e582050a
2 changed files with 15 additions and 2 deletions
|
@ -151,8 +151,8 @@ const onPlayerReady = (player, options) => {
|
|||
* Never shows if the endscreen plugin is present
|
||||
*/
|
||||
const mobileUi = function(options) {
|
||||
// if (videojs.browser.IS_ANDROID || videojs.browser.IS_IOS) {
|
||||
if (videojs.browser.IS_ANDROID) {
|
||||
// target both iOS and Android
|
||||
if (videojs.browser.IS_ANDROID || videojs.browser.IS_IOS) {
|
||||
this.ready(() => {
|
||||
onPlayerReady(this, videojs.mergeOptions(defaults, options));
|
||||
});
|
||||
|
|
|
@ -109,6 +109,12 @@ function VideoViewer(props: Props) {
|
|||
videoTheaterMode,
|
||||
isMarkdownOrComment,
|
||||
} = props;
|
||||
|
||||
const IS_IOS =
|
||||
(/iPad|iPhone|iPod/.test(navigator.platform) ||
|
||||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&
|
||||
!window.MSStream;
|
||||
|
||||
const permanentUrl = claim && claim.permanent_url;
|
||||
const adApprovedChannelIds = homepageData ? getAllIds(homepageData) : [];
|
||||
const claimId = claim && claim.claim_id;
|
||||
|
@ -368,6 +374,13 @@ function VideoViewer(props: Props) {
|
|||
// player.muted(true);
|
||||
// another version had player.play()
|
||||
}
|
||||
} else {
|
||||
const isPaused = player.paused();
|
||||
if (IS_IOS && isPaused) {
|
||||
document.getElementsByClassName('video-js--tap-to-unmute')[0].style.visibility = 'visible';
|
||||
player.muted(true);
|
||||
const iosResponse = player.play();
|
||||
}
|
||||
}
|
||||
setIsLoading(false);
|
||||
setIsPlaying(false);
|
||||
|
|
Loading…
Reference in a new issue