问题
I am trying to send an HTML email with a video embedded in the code and view it on the native email app for iOS devices. The native iOS mail app has supported HTML5 video elements and I have tested this on many occasions in the past few years.
Last week after sending a few video emails, I noticed that the media player in the native app would load, render the initial frame of the video, but not play the video. I've gone through the iOS software release history to see if there was anything that may have affected this behavior but was unsuccessful.
Below is the email
<html>
<head>
<title>TEST</title>
<style></style>
</head>
<body>
<div id="html5-video">
<p>THIS IS A HTML5 VIDEO</p>
<video controls>
<source src="http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4" type="video/mp4">
<p>Your browser does not support H.264/MP4.</p>
</video>
</div>
</body>
</html>
Additional notes: - video plays fine in other supported email environments - iOS supports the H.264/MP4 video file format - the issue started occurring sometime in March or April
Any help pointing me in the right direction will be greatly appreciated :)
回答1:
You have a slight inaccuracy in your question.
iOS supports the file format of MP4
Almost! It actually supports some MP4 files, but not all of them.
You need to closely follow the guidance that Apple issue if you want the video to play - they protect their brand by refusing to attempt to play videos that could look poor on the device...
In particular, they want you to adhere to certain conditions for bit rates, sizes, and even request that your HTTP server supports byte-range requests.
If you meet these conditions - then the video should play.
来源:https://stackoverflow.com/questions/29926248/html5-video-not-playing-in-native-ios-email-client-2015