@@ -352,7 +325,6 @@
-->
- 1{{swiperArray}}2
@@ -687,6 +659,7 @@ export default {
},
data() {
return {
+ isFullscreen: false, // 添加全屏状态跟踪
globalData: getApp().globalData,
videoContextTemp: {},
goImLoading: false, // 跳转im的loading
@@ -1240,7 +1213,9 @@ export default {
console.log("showVideo that.swiperArray", that.swiperArray);
this.videoContext = uni.createVideoContext(`${e.id}`, this);
that.videoContextTemp = that.videoContext;
- this.videoContext.requestFullScreen();
+ this.videoContext.requestFullScreen({
+ direction: "landscape", // 横屏全屏
+ });
this.videoContext.hideStatusBar();
this.videoContext.play();
},
@@ -1283,11 +1258,14 @@ export default {
}
},
fullScreen(e) {
- console.log(e);
- if (!e.detail.fullScreen) {
- this.videoContext.stop();
- }
- },
+ console.log(e);
+ this.muted = true;
+ this.isFullscreen = e.detail.fullScreen; // 更新全屏状态
+
+ if (!e.detail.fullScreen) {
+ this.videoContext.stop();
+ }
+ },
shareVideo(e) {
var that = this;
console.log(e);
@@ -1651,31 +1629,86 @@ export default {
.u-swiper__wrapper__item {
margin-right: 10px;
}
+
image {
border-radius: 4px !important;
}
+
+ .banner-scroll {
+ width: 100%;
+ white-space: nowrap;
+
+ .scroll-content {
+ display: inline-block;
+ white-space: nowrap;
+
+ .scroll-item {
+ display: inline-block;
+ width: 58px;
+ height: 58px;
+ margin-right: 12px;
+ vertical-align: top;
+
+ &:last-child {
+ margin-right: 0;
+ }
+
+ .videoContainer {
+ position: relative;
+ background-color: #000; // 黑色背景
+
+ .theVideo {
+ width: 100%;
+ height: 100%;
+
+ // 小图时隐藏控制栏
+ ::v-deep .uni-video-controls {
+ display: none !important;
+ }
+
+ // 全屏时显示控制栏
+ ::v-deep .uni-video-fullscreen-controls {
+ display: block !important;
+ }
+ }
+
+ // 小图时只显示居中的播放按钮
+ ::v-deep .uni-video-cover-play-button {
+ display: block !important;
+ width: 40px;
+ height: 40px;
+ margin: auto;
+ }
+ }
+ }
+ }
+ }
+
// .swiper {
- // // 为最后一个视频项目添加特殊处理
- // swiper-item:last-child {
- // .videoContainer {
- // // 确保视频容器不会被裁剪
- // overflow: visible !important;
-
- // .theVideo {
- // // 确保视频元素能够完整显示
- // width: 100%;
- // height: 100%;
- // }
-
- // .shareVideo {
- // // 调整分享按钮位置,确保不会遮挡视频
- // right: 10px;
- // bottom: 10px;
- // }
- // }
- // }
- // }
+
+ // // 为最后一个视频项目添加特殊处理
+ // swiper-item:last-child {
+ // .videoContainer {
+ // // 确保视频容器不会被裁剪
+ // overflow: visible !important;
+
+ // .theVideo {
+ // // 确保视频元素能够完整显示
+ // width: 100%;
+ // height: 100%;
+ // }
+
+ // .shareVideo {
+ // // 调整分享按钮位置,确保不会遮挡视频
+ // right: 10px;
+ // bottom: 10px;
+ // }
+ // }
+ // }
+ // }
}
+
+
.m-state {
position: fixed;
left: 0;