后浪云百度小程序教程:VideoContext

  • VideoContext
    • 示例
      • 图片示例
      • 代码示例
    • 错误码
      • Android
      • iOS

    VideoContext

    解释: swan.createVideoContext 的返回值

    示例

    跳转编辑工具

    在开发者工具中打开

    在 WEB IDE 中打开

    扫码体验

    代码示例

    后浪云百度小程序教程:VideoContext插图

    请使用百度APP扫码

    图片示例

    后浪云百度小程序教程:VideoContext插图1

    代码示例

    • SWAN
    • JS
     
     
     
    1. <view class="wrap">
    2. <video id="myVideo" enable-danmu="true" src="https://b.bdstatic.com/swan-temp/940fe716b0eaad38f47b209d61657490.mp4"></video>
    3. <button type="primary" bindtap="play">play</button>
    4. <button type="primary" bindtap="stop">stop</button>
    5. <button type="primary" bindtap="pause">pause</button>
    6. <button type="primary" bindtap="seek">seek</button>
    7. <button type="primary" bindtap="sendDanmu">sendDanmu</button>
    8. <button type="primary" bindtap="fullScreen">requestFullScreen</button>
    9. <button type="primary" data-set="0.75" bindtap="playbackRate">点击0.75倍速播放</button>
    10. <button type="primary" data-set="1.0" bindtap="playbackRate">点击1.0倍速播放</button>
    11. <button type="primary" data-set="1.25" bindtap="playbackRate">点击1.25倍速播放</button>
    12. <button type="primary" data-set="1.5" bindtap="playbackRate">点击1.5倍速播放</button>
    13. <button type="primary" data-set="2.0" bindtap="playbackRate">点击2.0倍速播放</button>
    14. </view>

    错误码

    Android

    错误码 说明

    202

    解析失败,请检查参数是否正确

    1001

    执行失败

    iOS

    错误码 说明

    202

    解析失败,请检查参数是否正确

    THE END