- 当前 Bug 的表现(可附上截图)
安卓web-view嵌套网页的小程序,H5的ios 安卓以及ios的小程序都可以播放mp4 mov格式视频,但是安卓的小程序不能播放mov,以及mov转成h264的mp4视频
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
function video_play(obj, cb, type) {
var box = $("<aside class=‘videoBox’ id=‘videoBox’ style=‘display: flex;justify-content: center;align-items: center;’></aside>").appendTo($(‘body’)).show();
if (type == 3) {
var url = vidUrl;
} else {
var url = obj.siblings(‘video’).attr(‘src’);
}
var poster = obj.siblings(‘video’).attr(‘poster’);
var container = $(’<video controls playsinline x-webkit-airplay webkit-playsinline x5-video-player-type=“h5” x5-videoplayer-fullscreen x5-video-ignore-metadata></video>’);
container.attr(‘src’, url);
container.appendTo(box);
container[0].onloadedmetadata = function () {
var videoW = container[0].videoWidth;
var videoH = container[0].videoHeight;
if (videoW > videoH) {
container.css({
‘width’: ‘100%’
})
} else {
container.css({
‘height’: ‘100%’
})
}
container[0].play();
}
container[0].addEventListener(‘ended’, function () {
// if (cb) cb();
}, false);
var close = $("<a class=‘close’></a>").appendTo(box).one(‘click’, function (e) {
box.remove();
if (cb) cb();
});
} //end event