Video/audio compatibility on ios/android, iosandroid
1. audio automatic playback
1 <audio src='xxx.mp3 'autoplay> </audio>
The above is the audio tag autoplay attribute, which indicates automatic playback. However, some Android browsers and safari on ios do not play the video automatically.
Most Android and ios players can know how to play videos.
If the iPhone 5 and iPhone 6 s versions are upgraded to the same version, the iPhone 5 can be played automatically, but the iPhone 6 s won't. This situation can be referred to: http://www.w3cmark.com/2016/434.html
In Yixin, ios can play automatically, but Android cannot play automatically.
Note the following points on the reference page: Two function methods will be executed, and three function methods will be executed in Yixin. If Android is not tested, you can test the function by yourself.
Solution:
Ios:, Yixin automatic playback,
Android: automatic playback
Other browsers: Set a front page or button to guide the user to trigger the event and execute the play () method of audio.
2. Automatic video Playback
1 <video src = "xxx.mp4" autoplay> </video>
The situation is basically the same as that of audio. A little difference is that in Android, videos are not automatically played and need to be played manually.
In this solution, we need to classify Android Yixin as another browser processing solution mentioned above.
3. The video Android video cannot be hidden after playback, and the problem of keeping the video recommendation interface unchanged cannot go into the next original display interface
(Video recommendation page-figure)
At first, the video tag is hidden for the ended event triggered when the video is played. The result is not good ~, Whether the ended event is not triggered, and then an alert test is put in the ended callback function,
If a test is triggered to alert, the ended event is executed normally.
Then I thought that since the video can be executed, I would be a little bit harsh. After ended, I removed the video tag. Finally, I still cannot !!
After that, various queries and various attempts will not work.
Currently, you can only jump to the next page by redirecting to the page. Location. href = 'Next interface Path'
(Hope you can solve this problem by not redirecting to the page)