erekook 11 months ago
parent
commit
0344a6e503
3 changed files with 12 additions and 14 deletions
  1. 10 12
      pages/collect-video/video.js
  2. 1 1
      pages/collect-video/video.wxml
  3. 1 1
      project.private.config.json

+ 10 - 12
pages/collect-video/video.js

@@ -6,7 +6,7 @@ import {
   getCollectRealVideoUrl,
   getRecCollectList,
 } from "../../api/api";
-import { rnd, goToVideoDetail, SendEvent } from "../../utils/util";
+import { rnd, SendEvent } from "../../utils/util";
 import { apple } from "../../config/config";
 
 const app = getApp();
@@ -70,6 +70,10 @@ Page({
       });
       this.interstitalLoad();
       this.rewardVideoLoad();
+      setTimeout(() => {
+        this.interstitalPlayFn();
+      }, 5000);
+
       // 获取合集视频详情
       this.getCollectVideoDetail();
       this.loadVideoList();
@@ -177,8 +181,6 @@ Page({
         return false;
       }
 
-      // 2. 如果视频ID在已解锁列表中,当前视频解锁
-      console.log(JSON.parse(wx.getStorageSync("unlock_collect_ids") || "[]"));
       if (unlockCollectIds.includes(this.data.collectId)) {
         return false;
       }
@@ -194,6 +196,11 @@ Page({
       this.setData({
         "videoDetail.playUrl": res.url_info[0].url,
       });
+      setTimeout(() => {
+        const videoContext = wx.createVideoContext("my-video");
+        videoContext.play();
+      }, 200);
+      // 获取视频实例并播放
     } catch (error) {}
   },
 
@@ -426,15 +433,6 @@ Page({
   // 分享给朋友
   onShareAppMessage(e) {},
 
-  // 跳转视频详情
-  goToVideoDetail(videoId, tagId) {
-    // 使用公共的goToVideoDetail函数
-    goToVideoDetail({
-      videoId: videoId,
-      tagId: tagId,
-    });
-  },
-
   // 激励视频加载
   rewardVideoLoad() {
     if (this.data.globalConfig.isShowReward !== 1) return;

+ 1 - 1
pages/collect-video/video.wxml

@@ -2,7 +2,7 @@
 <view class="collect-video-container">
   <view class="video-main">
     <block wx:if="{{eps && eps.length > 0}}">
-      <video autoplay="{{true}}" src="{{videoDetail.playUrl}}" direction="{{0}}" poster="{{videoDetail.cover_image}}"
+      <video autoplay="{{true}}" src="{{videoDetail.playUrl}}" direction="{{0}}"
         bindplay="onVideoPlay" bindpause="onVideoPause" bindended="onVideoEnd" class="my-video" id="my-video"
         style="height: 100%" bindtimeupdate="onVideoUpdate" bindseekcomplete="onVideoSeek"
         bindloadedmetadata="onVideoLoaded" x5-video-player-type="h5" x5-video-player-fullscreen="true" x5-video-orientation="portrait">

+ 1 - 1
project.private.config.json

@@ -26,7 +26,7 @@
         {
           "name": "合集视频",
           "pathName": "pages/collect-video/video",
-          "query": "collectId=1",
+          "query": "collectId=3",
           "scene": null,
           "launchMode": "default",
           "partialCompile": {