<template>
<view class="content">
<view class="player-content">
<live-player id="livePlayer" ref='livePlayer' class="live-player" catchtouchmove :src="sourceUrl" autoplay
background-mute sound-mode="speaker" mode='RTC' @statechange="statechange" @click="handleControlbar">
<view class="player-tool" style="bottom:-60rpx">
<view class="tools">
ghjgj
</view>
</view>
</live-player>
</view>
</view>
</template>
<script setup>
import {
ref
} from "vue"
uni.createLivePlayerContext("livePlayer")
</script>
<style lang="scss" scoped>
.content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.player-content {
position: relative;
width: 100%;
height: 450rpx;
display: flex;
background-size: 100% 100%;
.live-player {
width: 100%;
height: 100%;
position: relative;
}
}
}
//播放器弹出工具
.player-tool {
width: 100%;
height: 60rpx;
background-image: linear-gradient(0deg, rgba(0, 0, 0, .6), transparent);
display: flex;
align-items: center;
justify-content: space-between;
position: absolute;
left: 0;
padding: 0 45rpx;
transition: all 0.3s;
.tools {
height: 100%;
width: auto;
display: flex;
align-items: center;
.full-screen {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.iconfont {
color: #fff;
font-weight: bold;
}
}
.cruise {
display: flex;
align-items: center;
justify-content: center;
margin-left: 25rpx;
.iconfont {
color: #E45A3E;
font-size: 45rpx;
}
}
}
}
</style>
2 个回复
套马杆的套子 - 没有解决不了的问题,只有解决不完的问题
刚测试了下,微信小程序没问题
YUANRJ
app端不支持,参考文档