Disable iPhone Safari video tagging video automatically by full screen method

  • 2020-05-13 03:19:19
  • OfStack

Recently, I made a WeChat page project on the mobile terminal. There is video playing in the WeChat page, but the automatic full-screen playing of IOS should be disabled (the premise is that video tag must be used).
Such as:


<video id="post" autoplay loop preload="auto">
<source src="foo.mp4" type="video/mp4">
</video>

Click on iPhone safari and the video will pop up and play in full screen.

I looked at the answers given on the Internet, and I quote:

You can add an "webkit-playsinline" attribute to the video tag, as follows:


<video id="video" width="280" height="140" webkit-playsinline ></video>

I mean does that solve the problem? The answer, of course, is no...

Of course, when using web video in iOS APP, full-screen playback can be prohibited. The method is as follows:

The front-end adds the video tag to the property webkit-playsinline, such as:


<video id="player" width="480" height="320" webkit-playsinline>

In Obj-C, add configuration:


webview.allowsInlineMediaPlayback = YES

Some netizens answered the question like this:

Transcode the video and use ajax to segment the request data to populate canvas.

Of course, if you really need to exit the full screen, you can use this method, but after all, it's not necessary.

So the bottom line is: there is no way to disable iPhone Safari video tagging video automatically in full screen.


Related articles: