<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                #### video 視頻。 | 屬性名 | 類型 | 默認值 | 說明 | 最低版本 | | ----------------------- | ------------ | ------- | ---------------------------------------- | ---------------------------------------- | | src | String | | 要播放視頻的資源地址 | | | initial-time | Number | | 指定視頻初始播放位置 | [1.6.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | duration | Number | | 指定視頻時長 | [1.1.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | controls | Boolean | true | 是否顯示默認播放控件(播放/暫停按鈕、播放進度、時間) | | | danmu-list | Object Array | | 彈幕列表 | | | danmu-btn | Boolean | false | 是否顯示彈幕按鈕,只在初始化時有效,不能動態變更 | | | enable-danmu | Boolean | false | 是否展示彈幕,只在初始化時有效,不能動態變更 | | | autoplay | Boolean | false | 是否自動播放 | | | loop | Boolean | false | 是否循環播放 | [1.4.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | muted | Boolean | false | 是否靜音播放 | [1.4.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | page-gesture | Boolean | false | 在非全屏模式下,是否開啟亮度與音量調節手勢 | [1.6.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | direction | Number | | 設置全屏時視頻的方向,不指定則根據寬高比自動判斷。有效值為 0(正常豎向), 90(屏幕逆時針90度), -90(屏幕順時針90度) | [1.7.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | show-progress | Boolean | true | 若不設置,寬度大于240時才會顯示 | [1.9.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | show-fullscreen-btn | Boolean | true | 是否顯示全屏按鈕 | [1.9.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | show-play-btn | Boolean | true | 是否顯示視頻底部控制欄的播放按鈕 | [1.9.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | show-center-play-btn | Boolean | true | 是否顯示視頻中間的播放按鈕 | [1.9.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | enable-progress-gesture | Boolean | true | 是否開啟控制進度的手勢 | [1.9.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | objectFit | String | contain | 當視頻大小與 video 容器大小不一致時,視頻的表現形式。contain:包含,fill:填充,cover:覆蓋 | | | poster | String | | 視頻封面的圖片網絡資源地址,如果 controls 屬性值為 false 則設置 poster 無效 | | | bindplay | EventHandle | | 當開始/繼續播放時觸發play事件 | | | bindpause | EventHandle | | 當暫停播放時觸發 pause 事件 | | | bindended | EventHandle | | 當播放到末尾時觸發 ended 事件 | | | bindtimeupdate | EventHandle | | 播放進度變化時觸發,event.detail = {currentTime, duration} 。觸發頻率 250ms 一次 | | | bindfullscreenchange | EventHandle | | 當視頻進入和退出全屏是觸發,event.detail = {fullScreen, direction},direction取為 vertical 或 horizontal | [1.4.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | bindwaiting | EventHandle | | 視頻出現緩沖時觸發 | [1.7.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | binderror | EventHandle | | 視頻播放出錯時觸發 | [1.7.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | `<video />` 默認寬度300px、高度225px,可通過wxss設置寬高。 **示例代碼:** ``` <view class="section tc"> <video src="{{src}}" controls ></video> <view class="btn-area"> <button bindtap="bindButtonTap">獲取視頻</button> </view> </view> <view class="section tc"> <video id="myVideo" src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400" danmu-list="{{danmuList}}" enable-danmu danmu-btn controls></video> <view class="btn-area"> <button bindtap="bindButtonTap">獲取視頻</button> <input bindblur="bindInputBlur"/> <button bindtap="bindSendDanmu">發送彈幕</button> </view> </view> function getRandomColor () { let rgb = [] for (let i = 0 ; i < 3; ++i){ let color = Math.floor(Math.random() * 256).toString(16) color = color.length == 1 ? '0' + color : color rgb.push(color) } return '#' + rgb.join('') } Page({ onReady: function (res) { this.videoContext = wx.createVideoContext('myVideo') }, inputValue: '', data: { src: '', danmuList: [ { text: '第 1s 出現的彈幕', color: '#ff0000', time: 1 }, { text: '第 3s 出現的彈幕', color: '#ff00ff', time: 3 }] }, bindInputBlur: function(e) { this.inputValue = e.detail.value }, bindButtonTap: function() { var that = this wx.chooseVideo({ sourceType: ['album', 'camera'], maxDuration: 60, camera: ['front','back'], success: function(res) { that.setData({ src: res.tempFilePath }) } }) }, bindSendDanmu: function () { this.videoContext.sendDanmu({ text: this.inputValue, color: getRandomColor() }) } }) ``` 相關api:[wx.createVideoContext](https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-video.html) ##### 注意事項 1. `tip`: `video` 組件是由客戶端創建的原生組件,它的層級是最高的,不能通過 z-index 控制層級。 2. `tip`: 請勿在 `scroll-view`、`swiper`、`picker-view`、`movable-view` 中使用 `video` 組件。 3. `tip`: `css` 動畫對 `video` 組件無效。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看