qxj 1 周之前
父节点
当前提交
609a3538d6
共有 5 个文件被更改,包括 672 次插入665 次删除
  1. 0 83
      m3u8_fix_summary.md
  2. 3 11
      pages_course/components/like.vue
  3. 646 570
      pages_course/living.vue
  4. 1 1
      pages_course/livingList.vue
  5. 22 0
      static/svg/weixin36.svg

+ 0 - 83
m3u8_fix_summary.md

@@ -1,83 +0,0 @@
-# m3u8视频黑屏问题修复总结
-
-## 问题描述
-在iPhone或macOS小程序模拟器中播放m3u8格式的视频会出现黑屏现象,特别是在`liveType === 2`的录播模式下。
-
-## 修复方案
-
-### 1. 优化video组件属性配置
-- **启用缓存**: 将`custom-cache`和`http-cache`设置为`true`,改善m3u8流的缓存处理
-- **添加poster属性**: 设置`poster="liveItem.coverUrl || ''"`,为iOS设备提供视频封面
-- **预加载设置**: 添加`preload="auto"`,确保视频资源提前加载
-- **iOS兼容性**: 添加`playsinline="true"`和`webkit-playsinline="true"`,支持iOS内联播放
-- **X5内核优化**: 添加x5相关属性,优化在微信环境下的播放体验
-
-### 2. 播放逻辑优化
-- **平台检测**: 添加iOS设备检测逻辑
-- **延迟播放**: iOS设备延迟500ms播放,给video元素更多初始化时间
-- **错误重试**: 针对iOS+m3u8组合增加重试次数(5次)和延迟时间(3秒)
-
-### 3. 错误处理增强
-- **格式检测**: 识别m3u8格式并提供针对性处理
-- **重新初始化**: iOS设备播放失败时,先停止再重新播放
-- **用户提示**: 提供更明确的错误信息
-
-### 4. 用户体验改善
-- **加载状态**: 添加视频加载动画和状态提示
-- **平台提示**: 根据设备类型显示不同的加载文本
-- **视觉反馈**: 添加旋转动画和半透明遮罩
-
-## 修改的文件
-- `pages_course/living.vue`: 主要修改文件
-
-## 关键修改点
-
-### video组件配置
-```vue
-<video v-if="liveItem.videoUrl&&liveItem.liveType==2" 
-       :id="`myVideo_${liveId}`" 
-       :autoplay="true"
-       class="item" 
-       :src="liveItem.videoUrl" 
-       :controls="false" 
-       object-fit="contain"
-       :custom-cache="true" 
-       :http-cache="true" 
-       :poster="liveItem.coverUrl || ''"
-       preload="auto" 
-       :playsinline="true" 
-       :webkit-playsinline="true"
-       x5-video-player-type="h5" 
-       x5-video-player-fullscreen="true"
-       x5-video-orientation="portraint"
-       @loadstart="onVideoLoadStart" 
-       @canplay="onVideoCanPlay"
-       @error="videoError">
-</video>
-```
-
-### iOS延迟播放逻辑
-```javascript
-const systemInfo = uni.getSystemInfoSync();
-const isIOS = systemInfo.platform === 'ios' || systemInfo.system.toLowerCase().includes('ios');
-
-if (isIOS) {
-    setTimeout(() => {
-        videoContext.play();
-        console.log('iOS设备延迟播放m3u8视频');
-    }, 500);
-} else {
-    videoContext.play();
-}
-```
-
-## 测试建议
-1. 在iPhone真机上测试m3u8视频播放
-2. 在macOS小程序模拟器中测试
-3. 验证加载状态提示是否正常显示
-4. 测试错误重试机制是否有效
-
-## 注意事项
-- 确保m3u8视频源的CORS配置正确
-- 检查视频服务器的HTTPS配置
-- 验证视频格式和编码兼容性

+ 3 - 11
pages_course/components/like.vue

@@ -195,14 +195,6 @@
 </script>
 
 <style scoped lang="scss">
-	.like-container {
-		position: relative;
-	}
-
-	.image {
-		width: 48rpx;
-		height: 48rpx;
-	}
 
 	.like-icon {
 		font-size: 28rpx;
@@ -213,10 +205,10 @@
 	/* 动画容器 */
 	.like-container {
 		position: relative;
-
+		
 		.image {
-			width: 48rpx;
-			height: 48rpx;
+			width: 80rpx;
+			height: 80rpx;
 		}
 
 		/* 动画图标样式 */

文件差异内容过多而无法显示
+ 646 - 570
pages_course/living.vue


+ 1 - 1
pages_course/livingList.vue

@@ -4,7 +4,7 @@
 			:down="downOption" :up="upOption">
 			<view class="list">
 				<view class="list-item" @click="goLive(item)" v-for="(item,index) in list" :key="index">
-					<image class="img" v-if="item.liveImgUrl" :src="item.liveImgUrl"></image>
+					<image class="img" mode="aspectFill"  v-if="item.liveImgUrl" :src="item.liveImgUrl"></image>
 					<view class="info">
 						<text>{{item.liveName}}</text>
 					</view>

+ 22 - 0
static/svg/weixin36.svg

@@ -0,0 +1,22 @@
+<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="weixin_icon36" clip-path="url(#clip0_356_1034)">
+<g id="Vector" filter="url(#filter0_d_356_1034)">
+<path d="M23.66 14.0748C24.028 14.0748 24.39 14.107 24.754 14.153C23.774 8.90104 18.896 5 13.326 5C7.1 5 2 9.88147 2 16.084C2 19.6628 3.696 22.6018 6.532 24.8849L5.4 28.8044L9.36 26.5213C10.776 26.8412 11.912 27.1726 13.326 27.1726C13.682 27.1726 14.034 27.1542 14.382 27.1243C14.162 26.252 14.032 25.3406 14.032 24.3901C14.034 18.6962 18.282 14.0748 23.66 14.0748ZM17.572 10.542C18.428 10.542 18.99 11.1887 18.99 12.1692C18.99 13.145 18.428 13.7986 17.572 13.7986C16.726 13.7986 15.874 13.145 15.874 12.1692C15.874 11.1864 16.724 10.542 17.572 10.542ZM9.646 13.7986C8.796 13.7986 7.94 13.145 7.94 12.1692C7.94 11.1887 8.796 10.542 9.646 10.542C10.496 10.542 11.06 11.1864 11.06 12.1692C11.06 13.145 10.496 13.7986 9.646 13.7986ZM34 24.2336C34 19.023 29.468 14.7768 24.378 14.7768C18.988 14.7768 14.746 19.0253 14.746 24.2336C14.746 29.458 18.99 33.6904 24.378 33.6904C25.506 33.6904 26.644 33.3659 27.776 33.0391L30.882 35L30.03 31.7411C32.304 29.7756 34 27.1726 34 24.2336ZM21.254 22.6018C20.692 22.6018 20.122 21.9574 20.122 21.2992C20.122 20.6502 20.692 19.9965 21.254 19.9965C22.114 19.9965 22.672 20.6502 22.672 21.2992C22.672 21.9574 22.114 22.6018 21.254 22.6018ZM27.484 22.6018C26.926 22.6018 26.358 21.9574 26.358 21.2992C26.358 20.6502 26.924 19.9965 27.484 19.9965C28.336 19.9965 28.902 20.6502 28.902 21.2992C28.902 21.9574 28.336 22.6018 27.484 22.6018Z" fill="white"/>
+</g>
+</g>
+<defs>
+<filter id="filter0_d_356_1034" x="0" y="5" width="36" height="34" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
+<feOffset dy="2"/>
+<feGaussianBlur stdDeviation="1"/>
+<feComposite in2="hardAlpha" operator="out"/>
+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_356_1034"/>
+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_356_1034" result="shape"/>
+</filter>
+<clipPath id="clip0_356_1034">
+<rect width="36" height="36" fill="white"/>
+</clipPath>
+</defs>
+</svg>

部分文件因为文件数量过多而无法显示