<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 一、獲取狀態欄高度 ## 二、定義布局的內容距離頂部的間距為狀態欄高度 ## 三、定義左上角關閉布局 ## 四、定義輸入直播間名稱布局 ## 五、定義工具布局 ## 六、 定義開始視頻直播按鈕 ## 七、 最終代碼 ``` <template> <view> <live-pusher id="livePusher" ref="livePusher" class="livePusher" url="" :mode="mode" :muted="true" :enable-camera="enableCamera" :auto-focus="autoFocus" :beauty="beauty" whiteness="whiteness" device-position = "devicePosition" @statechange="statechange" @netstatus="netstatus" @error="error" :style="{'height' : windowHeight + 'px' }" style="width:750rpx" > </live-pusher> <view style="position: fixed; left : 0; right : 0; height: 500rpx;" :style="{'top' : statusBarHeight + 'px'}"> <!-- 關閉符號 --> <view class="flex align-center justify-center" style="width: 90rpx; height:90rpx; background-color: yellow;"> <text class="iconfont text-white">&#xe607;</text> </view> <!-- 輸入直播間標題 --> <view class="position-absolute rounded bg-danger " style="left: 90rpx; right : 100rpx; height: 160rpx;"></view> <!-- 工具 --> <view class="position-absolute right-0 flex flex-column" style="width: 100rpx;"> <view style="height: 120rpx; width: 100rpx;" class="flex flex-column align-center justify-center bg-main"></view> <view style="height: 120rpx; width: 100rpx;" class="flex flex-column align-center justify-center bg-main"></view> <view style="height: 120rpx; width: 100rpx;" class="flex flex-column align-center justify-center bg-main"></view> <view style="height: 120rpx; width: 100rpx;" class="flex flex-column align-center justify-center bg-main"></view> </view> </view> <!-- 開啟直播按鈕 --> <view class="position-fixed bg-main flex align-center justify-center rounded-circle" style="left : 100rpx; right : 100rpx; bottom: 100rpx; height : 120rpx;"> <text class="text-white font-md ">開始視頻直播</text> </view> </view> </template> <script> export default { data() { return { // 屏幕的高度 windowHeight : 0, // 保存live-pusher 實例對象 context : null, // 保存狀態欄高度 statusBarHeight : 0, // 推流地址,支持RTMP協議。 url : "", // 推流視頻模式,可取值:SD(標清), HD(高清), FHD(超清)。 mode : "SD", // 開啟攝像頭 enableCamera : true, // 自動聚集 autoFocus : true, // 美顏,取值范圍 0-9(iOS取值范圍為1) ,0 表示關閉。 beauty : 0, // 美白,取值范圍 0-9(iOS取值范圍為1) ,0 表示關閉。 whiteness : 0, // 前置或后置,值為front, back devicePosition : "back" }; }, onLoad() { const res = uni.getSystemInfoSync() this.windowHeight = res.windowHeight this.statusBarHeight = res.statusBarHeight }, onReady() { this.context = uni.createLivePusherContext("livePusher",this) this.startPreview() }, methods: { // 開啟預覽 startPreview(){ this.context.startPreview({ success : (e)=>{ console.log(e) } }) }, // 監聽直播狀態的變化 statechange(e){ console.log(e) }, // 監聽直播網絡狀態變化 netstatus(e){ console.log(e) }, // 監聽直播錯誤變化 error(e){ console.log(e) } } }; </script> <style></style> ```
                  <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>

                              哎呀哎呀视频在线观看