Skip to content

Commit

Permalink
仅针对安卓手百将播放器的播放模式切换回 h5 (#730)
Browse files Browse the repository at this point in the history
* 仅针对安卓手百将播放器的播放模式切换回 h5

* 修改判断条件
  • Loading branch information
clark-t authored Dec 4, 2019
1 parent fc6e901 commit 1b5a78a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/mip/src/components/mip-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ class MipVideo extends CustomElement {
// 兼容qq浏览器
videoEl.setAttribute('x5-playsinline', 'x5-playsinline')
videoEl.setAttribute('webkit-playsinline', 'webkit-playsinline')
videoEl.setAttribute('t7-video-player-type', 'inline')
// @2019.12.04 安卓手百在 t7-video-player-type=inline 的情况下,先锁屏再解锁之后,浏览器会自动播放。由于问题仅出现在安卓手百环境,因此仅针对安卓手百环境,将 t7-video-player-type 设置为 h5
if (util.platform.isAndroid() && util.platform.isBaiduApp()) {
videoEl.setAttribute('t7-video-player-type', 'h5')

}
else {
videoEl.setAttribute('t7-video-player-type', 'inline')
}
Array.prototype.slice.apply(this.element.childNodes).forEach(function (node) {
// FIXME: mip layout related, remove this!
if (node.nodeName.toLowerCase() === 'mip-i-space') {
Expand Down

0 comments on commit 1b5a78a

Please sign in to comment.