Skip to content

Commit

Permalink
fix:修复video文档
Browse files Browse the repository at this point in the history
  • Loading branch information
javascriptchen committed Oct 19, 2019
1 parent a8a2271 commit 131383d
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions docs/component/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,5 @@ export default {

- App平台:使用 `<video/>` 组件,打包 App 时必须勾选 manifest.json->App 模块权限配置->VideoPlayer 模块。
- App平台:如果使用的视频路径为本地路径,需要配置资源为释放模式:在 manifest.json 文件内 app-plus 节点下新增 runmode 配置,设置值为liberate。
- App平台:如果想使用非原生的video,即原来普通的html5自带video,可使用web-view组件load html页面,在其中使用普通h5 video。
- App平台:`iOS``<video/>`组件使用`autoplay`属性时,视频加载的`loading`会偏移到左上角。解决方法:去掉`<video/>`组件中的`autoplay`属性,在页面的`onReady`里,调用一下`uni.createVideoContext().play()`,就可以解决了。示例如下:

```html
<!-- #ifdef MP-ALIPAY -->
<video id="myVideo" src="test.mp4" autoplay />
<!-- #endif -->
<!-- #ifndef MP-ALIPAY -->
<video id="myVideo" src="test.mp4" />
<!-- #endif -->
<!-- tip:因为在支付宝小程序不支持uni.createVideoContext()方法,所以在支付宝小程序中使用条件编译,在`<video/>`组件中加上`autoplay`属性。 -->
```

```javascript
onReady: function() {
// #ifndef MP-ALIPAY
uni.createVideoContext('video的id').play();// 这里就相当于autoplay
// #endif
}
```
- App平台:如果想使用非原生的video,即原来普通的html5自带video,可使用web-view组件load html页面,在其中使用普通h5 video。
- H5平台: 在部分浏览器中会强制调用原生播放器播放(如:微信内置浏览器、UC浏览器等),在 x5 内核的浏览器中支持配置[同层播放器](https://x5.tencent.com/tbs/guide/video.html)

0 comments on commit 131383d

Please sign in to comment.