zhaoyadi 2 years ago
parent
commit
418a0af085

+ 2 - 0
kit/src/main/java/com/tencent/liteav/demo/superplayer/SuperPlayerModel.java

@@ -23,4 +23,6 @@ public class SuperPlayerModel {
     public boolean isEnableCache = false; // 是否开启缓存能力,默认关闭
 
     public boolean isLast = false;
+
+    public boolean isLock = false;
 }

+ 2 - 1
kit/src/main/java/com/tencent/liteav/demo/superplayer/SuperPlayerView.java

@@ -167,7 +167,7 @@ public class SuperPlayerView extends RelativeLayout implements TimeoutUtil.Liste
 
     public void maybePlayIndexModel(int index) {
         int playIndex = (index) % mSuperPlayerModelList.size();
-        SuperPlayerModel playModel = mSuperPlayerModelList.get(mPlayIndex);
+        SuperPlayerModel playModel = mSuperPlayerModelList.get(playIndex);
 
         mPlayerViewCallback.onPlayPrepare(playIndex, playModel);
     }
@@ -183,6 +183,7 @@ public class SuperPlayerView extends RelativeLayout implements TimeoutUtil.Liste
 
     /* 播放指定的 */
     private void playModelInList(int index) {
+        if (index == mPlayIndex) return;
         if (mIsTimeOut) return;
         if ((index >= mSuperPlayerModelList.size())) return;
 

+ 19 - 0
kit/src/main/java/com/tencent/liteav/demo/superplayer/ui/view/RoundImageView.java

@@ -3,7 +3,10 @@ package com.tencent.liteav.demo.superplayer.ui.view;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
 import android.graphics.Path;
+import android.graphics.Rect;
 import android.graphics.RectF;
 import android.util.AttributeSet;
 import android.widget.ImageView;
@@ -19,6 +22,11 @@ public class RoundImageView extends androidx.appcompat.widget.AppCompatImageView
     private float bottomLeftRadius;
     private float bottomRightRadius;
 
+    private boolean lock = false;
+
+    private Paint lockPaint = new Paint();
+    private Rect rect = new Rect();
+
     public RoundImageView(Context context) {
         this(context, null);
     }
@@ -42,14 +50,25 @@ public class RoundImageView extends androidx.appcompat.widget.AppCompatImageView
             bottomRightRadius = a.getDimension(R.styleable.RoundImageView_bottomRightRadius, radius);
             a.recycle();
         }
+
+        lockPaint.setColor(Color.parseColor("#66000000"));
+        lockPaint.setStyle(Paint.Style.FILL);
     }
 
+    public void setLock(boolean lock) {
+        this.lock = lock;
+        invalidate();
+    }
 
     @Override
     protected void onDraw(Canvas canvas) {
         canvas.save();
         canvas.clipPath(getClipPath(getWidth(), getHeight()));
         super.onDraw(canvas);
+        if (lock) {
+            rect.set(0, 0, getWidth(), getHeight());
+            canvas.drawRect(rect, lockPaint);
+        }
         canvas.restore();
     }
 

+ 24 - 7
kit/src/main/res/layout/superplayer_item_vod.xml

@@ -1,23 +1,40 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:background="@drawable/item_vod"
     android:layout_marginBottom="6dp"
+    android:background="@drawable/item_vod"
     android:orientation="vertical">
 
-    <com.tencent.liteav.demo.superplayer.ui.view.RoundImageView
-        android:id="@+id/superplayer_iv"
+    <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="143dp"
         android:layout_height="80dp"
         android:layout_marginLeft="9dp"
         android:layout_marginTop="9dp"
         android:layout_marginRight="9dp"
         android:layout_marginBottom="3dp"
-        android:background="@drawable/item_vod"
-        android:scaleType="centerCrop"
-        app:radius="10dp"/>
+        android:background="@drawable/item_vod">
+
+        <com.tencent.liteav.demo.superplayer.ui.view.RoundImageView
+            android:id="@+id/superplayer_iv"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:scaleType="centerCrop"
+            app:radius="10dp" />
+
+        <ImageView
+            android:id="@+id/superplayer_lock"
+            android:layout_width="20dp"
+            android:layout_height="20dp"
+            android:src="@mipmap/video_lock"
+            android:visibility="gone"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
 
     <TextView
         android:id="@+id/superplayer_tv"

BIN
kit/src/main/res/mipmap-hdpi/video_lock.png


BIN
kit/src/main/res/mipmap-mdpi/video_lock.png


BIN
kit/src/main/res/mipmap-xhdpi/video_lock.png


BIN
kit/src/main/res/mipmap-xxhdpi/video_lock.png


BIN
kit/src/main/res/mipmap-xxxhdpi/video_lock.png


+ 372 - 241
ui/src/main/assets/data.json

@@ -1,27 +1,27 @@
 {
-  "id": "1539434275092762625",
-  "name": "细菌病毒特工队",
-  "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF",
-  "imgCoverMini": "https://img.luojigou.vip/Fi_4_0SMW-mEb6LW5gxOy9WdeUgR",
-  "createTime": "2022-06-22 10:25:07",
-  "updateTime": "2022-06-22 10:26:39",
-  "price": 45.00,
-  "markingPrice": 99.00,
-  "categoryId": "1533687977056067586",
-  "courseCount": 10,
-  "aiCourseSpuId": "1539434275029848065",
-  "suitAge": "4-12",
+  "id": "1540203667959226370",
+  "name": "小鸡彩虹英文版第二季",
+  "imgCover": "https://video.training.luojigou.vip/Fjer1kevKlYNJKXE80imW1cJv0kf_low.mp4",
+  "imgCoverMini": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-",
+  "createTime": "2022-06-24 13:22:24",
+  "updateTime": "2022-06-24 13:22:56",
+  "price": 6.9,
+  "markingPrice": 7.9,
+  "categoryId": "1533687853001138178",
+  "courseCount": 13,
+  "aiCourseSpuId": "1540203667934060546",
+  "suitAge": "3-6",
   "wxNumber": null,
   "wxQrCode": null,
   "wxName": null,
   "wxHeadImg": null,
-  "description": "<p><img src=\"https://img.luojigou.vip/Fhj9Nq4mNp4TjylUHqFjrsaMpDlI\" /></p>",
+  "description": "<p><img src=\"https://img.luojigou.vip/FsgZtHx8XTH3cQbwF-5xZbFdc8YG\" /></p>",
   "mediaType": 0,
-  "simpleDescription": "给孩子的微生物百科和健康指南!",
-  "sort": 996,
+  "simpleDescription": "国内独家首创的彩色水墨画风;严谨的幼儿内容研发体系,全新理念的世界观架构;绿色、健康、零暴力的内容!",
+  "sort": 998,
   "showChapter": 0,
   "courseType": 0,
-  "subCategoryId": "1533687977056067586",
+  "subCategoryId": "1533687853001138178",
   "activityTag": null,
   "courseTags": [],
   "paidCount": 2,
@@ -29,42 +29,42 @@
   "latestLearnedRecord": null,
   "abilityList": [],
   "commentCount": 0,
-  "shareCount": 4,
-  "collectCount": 1,
+  "shareCount": 22,
+  "collectCount": 2,
   "isCollect": 0,
-  "hasPaid": 1,
+  "hasPaid": 0,
   "isComment": 0,
   "isShare": 0,
   "imgCoverWidth": null,
   "imgCoverHeight": null,
-  "shareUrl": "https://zaojiao.net/luojigou_web_shop_html/#/growTogether/group/course?id=1539434275092762625",
-  "shareUrlQRCode": "http://app.zaojiao.net//QRCode/aiCourse/sku?id=1539434275092762625",
+  "shareUrl": "https://zaojiao.net/luojigou_web_shop_html/#/growTogether/group/course?id=1540203667959226370",
+  "shareUrlQRCode": "http://app.zaojiao.net//QRCode/aiCourse/sku?id=1540203667959226370",
   "groupBuyActivity": null,
   "groupBuyActivityId": null,
   "groupBuyActivityUrl": null,
-  "show_cover_img": 0,
+  "showCoverImg": 0,
   "spu": {
-    "id": "1539434275029848065",
-    "name": "细菌病毒特工队",
-    "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF",
-    "imgCoverMini": "https://img.luojigou.vip/Fi_4_0SMW-mEb6LW5gxOy9WdeUgR",
-    "videoUrl": null,
-    "createTime": "2022-06-22 10:25:07",
-    "updateTime": "2022-06-22 10:26:39",
-    "price": 45.00,
-    "markingPrice": 99.00,
-    "categoryId": "1533687977056067586",
-    "suitAge": "4-12",
+    "id": "1540203667934060546",
+    "name": "小鸡彩虹英文版第二季",
+    "imgCover": "https://img.luojigou.vip/Fmsz81vTpT9iVWuws2tVOuDwI9kY,https://img.luojigou.vip/FsD53yL9bhdd33eRjHKPv11lwe25",
+    "imgCoverMini": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-",
+    "videoUrl": "https://video.training.luojigou.vip/Fjer1kevKlYNJKXE80imW1cJv0kf_low.mp4",
+    "createTime": "2022-06-24 13:22:24",
+    "updateTime": "2022-06-24 13:22:56",
+    "price": 6.9,
+    "markingPrice": 7.9,
+    "categoryId": "1533687853001138178",
+    "suitAge": "3-6",
     "parentNotice": null,
-    "courseCount": 10,
+    "courseCount": 13,
     "description": null,
     "outline": null,
     "notice": null,
-    "simpleDescription": "给孩子的微生物百科和健康指南!",
+    "simpleDescription": "国内独家首创的彩色水墨画风;严谨的幼儿内容研发体系,全新理念的世界观架构;绿色、健康、零暴力的内容!",
     "mediaType": 0,
     "status": 1,
     "isDelete": 0,
-    "sort": 996,
+    "sort": 998,
     "showChapter": 0,
     "isShow": true,
     "showCoverImg": 0
@@ -73,29 +73,29 @@
   "getStarCount": 0,
   "chapterList": [
     {
-      "id": "1539436832552849410",
+      "id": "1540205198192320513",
       "name": "第1章",
-      "createTime": "2022-06-22 10:35:16",
+      "createTime": "2022-06-24 13:28:29",
       "updateTime": null,
-      "aiCourseSkuId": "1539434275092762625",
+      "aiCourseSkuId": "1540203667959226370",
       "sort": 0,
       "coverImgUrl": null,
       "itemList": [
         {
-          "id": "1539436832578015233",
-          "name": "1、为什么饭前便后要洗手?——大肠杆菌",
-          "videoId": "1566663169164734466",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205198213292034",
+          "name": "01 大苹果The Large Apple",
+          "videoId": "1540205198259429378",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 0,
-          "createTime": "2022-06-22 10:35:16",
-          "updateTime": "2022-09-06 18:03:39",
-          "readCount": 64,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:44",
+          "readCount": 251,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 1,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -104,42 +104,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 9,
-            "intervals": "[\n  [\n    0,\n    9\n  ]\n]",
-            "lastTime": 6,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "64",
+          "readCountStr": "251",
           "video": {
-            "id": "1566663169164734466",
-            "videoUrl": "http://video.training.luojigou.vip/lgEfvC6bXVyaVY1NfkpPbn3cDFtk_low.mp4",
-            "parentId": "1539436832578015233",
-            "createTime": "2022-09-05 13:43:01",
-            "updateTime": "2022-09-05 13:43:44",
+            "id": "1540205198259429378",
+            "videoUrl": "http://video.training.luojigou.vip/lm6giVlUMxuYKuVaBRTxRr6SNiO__low.mp4",
+            "parentId": "1540205198213292034",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:52",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/lgEfvC6bXVyaVY1NfkpPbn3cDFtk_low.mp4?vframe/jpg/offset/1",
-            "duration": "442.200000"
+            "thumbnailUrl": "http://video.training.luojigou.vip/lm6giVlUMxuYKuVaBRTxRr6SNiO__low.mp4?vframe/jpg/offset/1",
+            "duration": "291.280000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436832708038658",
-          "name": "2、流行性感冒为什么那么严重?——流感病毒",
-          "videoId": "1566663170158784514",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205198318149634",
+          "name": "02 堆云朵Building a Cloudman",
+          "videoId": "1540205198364286977",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 1,
-          "createTime": "2022-06-22 10:35:16",
-          "updateTime": "2022-09-06 18:03:39",
-          "readCount": 32,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:44",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -148,42 +148,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 217,
-            "intervals": "[\n  [\n    0,\n    217\n  ]\n]",
-            "lastTime": 3,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "32",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663170158784514",
-            "videoUrl": "http://video.training.luojigou.vip/lutTkyzxqVd6ZaGRPuamz9zIo7FT_low.mp4",
-            "parentId": "1539436832708038658",
-            "createTime": "2022-09-05 13:43:01",
-            "updateTime": "2022-09-05 13:43:43",
+            "id": "1540205198364286977",
+            "videoUrl": null,
+            "parentId": "1540205198318149634",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:52",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/lutTkyzxqVd6ZaGRPuamz9zIo7FT_low.mp4?vframe/jpg/offset/1",
-            "duration": "450.960000"
+            "thumbnailUrl": null,
+            "duration": "292.080000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436832821284865",
-          "name": "3、长毛的馒头还能吃吗?——黄曲霉",
-          "videoId": "1566663172432097282",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205198423007233",
+          "name": "03 小青的烦恼Berry’s Worries",
+          "videoId": "1540205198464950273",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 2,
-          "createTime": "2022-06-22 10:35:16",
-          "updateTime": "2022-09-06 18:03:39",
-          "readCount": 36,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:45",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -192,42 +192,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 43,
-            "intervals": "[\n  [\n    0,\n    3\n  ],\n  [\n    73,\n    76\n  ],\n  [\n    94,\n    96\n  ],\n  [\n    108,\n    122\n  ],\n  [\n    150,\n    151\n  ],\n  [\n    233,\n    243\n  ],\n  [\n    265,\n    266\n  ],\n  [\n    291,\n    292\n  ],\n  [\n    318,\n    322\n  ],\n  [\n    332,\n    336\n  ]\n]",
-            "lastTime": 3,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "36",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663172432097282",
-            "videoUrl": "http://video.training.luojigou.vip/lo2nPZU-uzFut8rLLV-89frF0ID1_low.mp4",
-            "parentId": "1539436832821284865",
-            "createTime": "2022-09-05 13:43:02",
-            "updateTime": "2022-09-05 13:43:44",
+            "id": "1540205198464950273",
+            "videoUrl": null,
+            "parentId": "1540205198423007233",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:52",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/lo2nPZU-uzFut8rLLV-89frF0ID1_low.mp4?vframe/jpg/offset/1",
-            "duration": "439.440000"
+            "thumbnailUrl": null,
+            "duration": "290.080000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436832930336769",
-          "name": "4、被狗咬伤了会怎么样?——狂犬病毒",
-          "videoId": "1566663173489061890",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205198523670529",
+          "name": "04 放风筝Flying a Kite",
+          "videoId": "1540205198565613570",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 3,
-          "createTime": "2022-06-22 10:35:16",
-          "updateTime": "2022-09-06 18:03:40",
-          "readCount": 26,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:45",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -236,42 +236,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 8,
-            "intervals": "[\n  [\n    0,\n    8\n  ]\n]",
-            "lastTime": 4,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "26",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663173489061890",
-            "videoUrl": "http://video.training.luojigou.vip/lqNYVChVvvISTwkadnUxRu5b_YTx_low.mp4",
-            "parentId": "1539436832930336769",
-            "createTime": "2022-09-05 13:43:02",
-            "updateTime": "2022-09-05 13:43:44",
+            "id": "1540205198565613570",
+            "videoUrl": null,
+            "parentId": "1540205198523670529",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:50",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/lqNYVChVvvISTwkadnUxRu5b_YTx_low.mp4?vframe/jpg/offset/1",
-            "duration": "459.040000"
+            "thumbnailUrl": null,
+            "duration": "287.240000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436833039388673",
-          "name": "5、面包有它才好吃!——酵母菌",
-          "videoId": "1566663174474723329",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205198624333825",
+          "name": "05 小绿的愿望Kiwi’s Wish",
+          "videoId": "1540205198670471170",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 4,
-          "createTime": "2022-06-22 10:35:17",
-          "updateTime": "2022-09-06 18:03:40",
-          "readCount": 26,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:45",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -280,42 +280,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 0,
-            "intervals": "[\n\n]",
-            "lastTime": 0,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "26",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663174474723329",
-            "videoUrl": "http://video.training.luojigou.vip/ljTcMdxJY5Jgrwb2Fq9pLggOA85D_low.mp4",
-            "parentId": "1539436833039388673",
-            "createTime": "2022-09-05 13:43:02",
-            "updateTime": "2022-09-05 13:43:44",
+            "id": "1540205198670471170",
+            "videoUrl": null,
+            "parentId": "1540205198624333825",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:51",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/ljTcMdxJY5Jgrwb2Fq9pLggOA85D_low.mp4?vframe/jpg/offset/1",
-            "duration": "431.920000"
+            "thumbnailUrl": null,
+            "duration": "291.880000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436833207160834",
-          "name": "6、牛奶的好朋友!——乳酸菌",
-          "videoId": "1566663175435218946",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205198724997121",
+          "name": "06 花裙子Berry’s Flower Skirt",
+          "videoId": "1540205198771134465",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 5,
-          "createTime": "2022-06-22 10:35:17",
-          "updateTime": "2022-09-06 18:03:40",
-          "readCount": 26,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:45",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -324,42 +324,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 40,
-            "intervals": "[\n  [\n    0,\n    40\n  ]\n]",
-            "lastTime": 40,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "26",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663175435218946",
-            "videoUrl": "http://video.training.luojigou.vip/lj6qZAqWrRCO-raj15IOIwA3dBIs_low.mp4",
-            "parentId": "1539436833207160834",
-            "createTime": "2022-09-05 13:43:02",
-            "updateTime": "2022-09-05 13:43:44",
+            "id": "1540205198771134465",
+            "videoUrl": null,
+            "parentId": "1540205198724997121",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:52",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/lj6qZAqWrRCO-raj15IOIwA3dBIs_low.mp4?vframe/jpg/offset/1",
-            "duration": "490.440000"
+            "thumbnailUrl": null,
+            "duration": "299.960000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436833370738689",
-          "name": "7、醋是怎么来的?——醋酸菌",
-          "videoId": "1566663176404103170",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205198829854722",
+          "name": "07 小蓝的发掘调查Indigo’s Big Discovery",
+          "videoId": "1540205198871797762",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 6,
-          "createTime": "2022-06-22 10:35:17",
-          "updateTime": "2022-09-06 18:03:40",
-          "readCount": 26,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:46",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -368,42 +368,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 0,
-            "intervals": "[\n\n]",
-            "lastTime": 0,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "26",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663176404103170",
-            "videoUrl": "http://video.training.luojigou.vip/ltZR9CKRaJR-m3gHnjYVcTJ6RkD-_low.mp4",
-            "parentId": "1539436833370738689",
-            "createTime": "2022-09-05 13:43:03",
-            "updateTime": "2022-09-05 13:43:43",
+            "id": "1540205198871797762",
+            "videoUrl": null,
+            "parentId": "1540205198829854722",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:50",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/ltZR9CKRaJR-m3gHnjYVcTJ6RkD-_low.mp4?vframe/jpg/offset/1",
-            "duration": "493.440000"
+            "thumbnailUrl": null,
+            "duration": "291.480000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436833504956417",
-          "name": "8、污染物的分解者——草履虫",
-          "videoId": "1566663177343627265",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205198930518018",
+          "name": "08 传说中的那个The Legendary Food",
+          "videoId": "1540205198976655361",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 7,
-          "createTime": "2022-06-22 10:35:17",
-          "updateTime": "2022-09-06 18:03:40",
-          "readCount": 26,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:46",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -412,42 +412,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 4,
-            "intervals": "[\n  [\n    0,\n    2\n  ],\n  [\n    253,\n    255\n  ]\n]",
-            "lastTime": 1,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "26",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663177343627265",
-            "videoUrl": "http://video.training.luojigou.vip/lp-7DHTRH66F9NZimrohOtcpJTdT_low.mp4",
-            "parentId": "1539436833504956417",
-            "createTime": "2022-09-05 13:43:03",
-            "updateTime": "2022-09-05 13:43:45",
+            "id": "1540205198976655361",
+            "videoUrl": null,
+            "parentId": "1540205198930518018",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:50",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/lp-7DHTRH66F9NZimrohOtcpJTdT_low.mp4?vframe/jpg/offset/1",
-            "duration": "483.840000"
+            "thumbnailUrl": null,
+            "duration": "291.680000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436833647562754",
-          "name": "9、亦正亦邪的蘑菇——食用菌",
-          "videoId": "1566663178312511490",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205199031181313",
+          "name": "09 小青的画Cherry the Model",
+          "videoId": "1540205199073124354",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 8,
-          "createTime": "2022-06-22 10:35:17",
-          "updateTime": "2022-09-06 18:03:41",
-          "readCount": 26,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:46",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -456,42 +456,42 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 0,
-            "intervals": "[\n\n]",
-            "lastTime": 0,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "26",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663178312511490",
-            "videoUrl": "http://video.training.luojigou.vip/lsYwmmKO0zZ8075WrP4WEwQo3J9o_low.mp4",
-            "parentId": "1539436833647562754",
-            "createTime": "2022-09-05 13:43:03",
-            "updateTime": "2022-09-05 13:43:44",
+            "id": "1540205199073124354",
+            "videoUrl": null,
+            "parentId": "1540205199031181313",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:51",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/lsYwmmKO0zZ8075WrP4WEwQo3J9o_low.mp4?vframe/jpg/offset/1",
-            "duration": "607.680000"
+            "thumbnailUrl": null,
+            "duration": "298.440000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         },
         {
-          "id": "1539436833760808962",
-          "name": "10、能做美食,也能致病——毛霉",
-          "videoId": "1566663179440779265",
-          "aiCourseSkuId": "1539434275092762625",
+          "id": "1540205199131844609",
+          "name": "10 超级机器人Super Robot",
+          "videoId": "1540205199173787649",
+          "aiCourseSkuId": "1540203667959226370",
           "sort": 9,
-          "createTime": "2022-06-22 10:35:17",
-          "updateTime": "2022-09-06 18:03:41",
-          "readCount": 26,
-          "aiCourseItemChapterId": "1539436832552849410",
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:46",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
           "type": 0,
           "payType": 0,
           "freeTime": 0,
           "audioId": null,
-          "imgCover": "https://img.luojigou.vip/FhwHdxUPiaNu8_KF3nEB4Reg1dUF?imageView2/0/q/50|imageslim",
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
           "richText": null,
           "splitList": null,
           "hasReport": 1,
@@ -500,29 +500,160 @@
           "hasReply": 0,
           "totalStarCount": 0,
           "getRecord": {
-            "validDuration": 1,
-            "intervals": "[\n  [\n    0,\n    1\n  ],\n  [\n    330,\n    330\n  ]\n]",
-            "lastTime": 330,
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
             "aiCourseItemId": null
           },
           "starList": [],
-          "readCountStr": "26",
+          "readCountStr": "4",
           "video": {
-            "id": "1566663179440779265",
-            "videoUrl": "http://video.training.luojigou.vip/lrhVfXMB_lykSoFBtdt6Ct5Iq-oi_low.mp4",
-            "parentId": "1539436833760808962",
-            "createTime": "2022-09-05 13:43:03",
-            "updateTime": "2022-09-05 13:43:45",
+            "id": "1540205199173787649",
+            "videoUrl": null,
+            "parentId": "1540205199131844609",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:52",
             "width": 1920,
             "height": 1080,
-            "thumbnailUrl": "http://video.training.luojigou.vip/lrhVfXMB_lykSoFBtdt6Ct5Iq-oi_low.mp4?vframe/jpg/offset/1",
-            "duration": "479.440000"
+            "thumbnailUrl": null,
+            "duration": "286.040000"
+          },
+          "hasClockIn": 0,
+          "getStarCount": 0
+        },
+        {
+          "id": "1540205199232507905",
+          "name": "11 茶博士Indigo the Tea Specialist",
+          "videoId": "1540205199274450945",
+          "aiCourseSkuId": "1540203667959226370",
+          "sort": 10,
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:46",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
+          "type": 0,
+          "payType": 0,
+          "freeTime": 0,
+          "audioId": null,
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
+          "richText": null,
+          "splitList": null,
+          "hasReport": 1,
+          "clockInUserCount": "0",
+          "enable": 1,
+          "hasReply": 0,
+          "totalStarCount": 0,
+          "getRecord": {
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
+            "aiCourseItemId": null
+          },
+          "starList": [],
+          "readCountStr": "4",
+          "video": {
+            "id": "1540205199274450945",
+            "videoUrl": null,
+            "parentId": "1540205199232507905",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:52",
+            "width": 1920,
+            "height": 1080,
+            "thumbnailUrl": null,
+            "duration": "294.440000"
+          },
+          "hasClockIn": 0,
+          "getStarCount": 0
+        },
+        {
+          "id": "1540205199333171201",
+          "name": "12 小青的杂货铺Berry the Vendor",
+          "videoId": "1540205199375114242",
+          "aiCourseSkuId": "1540203667959226370",
+          "sort": 11,
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:47",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
+          "type": 0,
+          "payType": 0,
+          "freeTime": 0,
+          "audioId": null,
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
+          "richText": null,
+          "splitList": null,
+          "hasReport": 1,
+          "clockInUserCount": "0",
+          "enable": 1,
+          "hasReply": 0,
+          "totalStarCount": 0,
+          "getRecord": {
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
+            "aiCourseItemId": null
+          },
+          "starList": [],
+          "readCountStr": "4",
+          "video": {
+            "id": "1540205199375114242",
+            "videoUrl": null,
+            "parentId": "1540205199333171201",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:51",
+            "width": 1920,
+            "height": 1080,
+            "thumbnailUrl": null,
+            "duration": "291.080000"
+          },
+          "hasClockIn": 0,
+          "getStarCount": 0
+        },
+        {
+          "id": "1540205199433834497",
+          "name": "13 大蛋糕The Big Cake",
+          "videoId": "1540205199475777537",
+          "aiCourseSkuId": "1540203667959226370",
+          "sort": 12,
+          "createTime": "2022-06-24 13:28:29",
+          "updateTime": "2022-09-14 14:19:47",
+          "readCount": 4,
+          "aiCourseItemChapterId": "1540205198192320513",
+          "type": 0,
+          "payType": 0,
+          "freeTime": 0,
+          "audioId": null,
+          "imgCover": "https://img.luojigou.vip/FnV8CLD1Ci-oF2SAiDERZ6yV7Ez-?imageView2/0/q/50|imageslim",
+          "richText": null,
+          "splitList": null,
+          "hasReport": 1,
+          "clockInUserCount": "0",
+          "enable": 1,
+          "hasReply": 0,
+          "totalStarCount": 0,
+          "getRecord": {
+            "validDuration": null,
+            "intervals": null,
+            "lastTime": null,
+            "aiCourseItemId": null
+          },
+          "starList": [],
+          "readCountStr": "4",
+          "video": {
+            "id": "1540205199475777537",
+            "videoUrl": null,
+            "parentId": "1540205199433834497",
+            "createTime": "2022-06-24 13:28:29",
+            "updateTime": "2022-06-24 14:15:52",
+            "width": 1920,
+            "height": 1080,
+            "thumbnailUrl": null,
+            "duration": "291.680000"
           },
           "hasClockIn": 0,
           "getStarCount": 0
         }
       ]
     }
-  ],
-  "videoUrl": null
+  ]
 }

+ 14 - 6
ui/src/main/java/com/tencent/liteav/demo/player/ui/PlayerListAdapter.java

@@ -6,6 +6,8 @@ import androidx.recyclerview.widget.RecyclerView;
 
 import android.graphics.Color;
 import android.graphics.Typeface;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Build;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.ViewGroup;
@@ -15,6 +17,7 @@ import android.widget.TextView;
 import com.bumptech.glide.Glide;
 import com.tencent.liteav.demo.player.R;
 import com.tencent.liteav.demo.superplayer.SuperPlayerModel;
+import com.tencent.liteav.demo.superplayer.ui.view.RoundImageView;
 
 import java.util.ArrayList;
 
@@ -70,20 +73,23 @@ public class PlayerListAdapter extends RecyclerView.Adapter<PlayerListAdapter.Vi
             holder.title.setTypeface(Typeface.DEFAULT);
         }
 
+        holder.thumb.setLock(videoModel.isLock);
+        holder.lock.setVisibility(videoModel.isLock ? View.VISIBLE : View.GONE);
+
         holder.title.setOnClickListener(v -> {
             if (mOnItemClickListener != null) {
-                mOnItemClickListener.onItemClick(videoModel,position);
+                mOnItemClickListener.onItemClick(videoModel, position);
             }
         });
 
         holder.thumb.setOnClickListener(v -> {
             if (mOnItemClickListener != null) {
-                mOnItemClickListener.onItemClick(videoModel,position);
+                mOnItemClickListener.onItemClick(videoModel, position);
             }
         });
     }
 
-    public void setIndex(int index){
+    public void setIndex(int index) {
         for (int i = 0; i < clickMark.size(); i++) {
             clickMark.set(i, false);
         }
@@ -99,12 +105,14 @@ public class PlayerListAdapter extends RecyclerView.Adapter<PlayerListAdapter.Vi
 
     public class ViewHolder extends RecyclerView.ViewHolder {
         private TextView title;
-        private ImageView thumb;
+        private RoundImageView thumb;
+        private ImageView lock;
 
         public ViewHolder(final View itemView) {
             super(itemView);
-            thumb = (ImageView) itemView.findViewById(R.id.superplayer_iv);
+            thumb = (RoundImageView) itemView.findViewById(R.id.superplayer_iv);
             title = (TextView) itemView.findViewById(R.id.superplayer_tv);
+            lock = (ImageView) itemView.findViewById(R.id.superplayer_lock);
         }
     }
 
@@ -129,6 +137,6 @@ public class PlayerListAdapter extends RecyclerView.Adapter<PlayerListAdapter.Vi
 
     public interface OnItemClickListener {
 
-        void onItemClick(SuperPlayerModel videoModel,int index);
+        void onItemClick(SuperPlayerModel videoModel, int index);
     }
 }

+ 2 - 0
ui/src/main/java/com/tencent/liteav/demo/player/util/ModelProvider.kt

@@ -15,6 +15,7 @@ object ModelProvider {
     val list: List<SuperPlayerModel>
         get() {
             val list: MutableList<SuperPlayerModel> = ArrayList()
+            val paidStatus = course.hasPaid == 1 ///已付费
 
             for (chapter in course.chapterList) {
                 for (section in chapter.itemList) {
@@ -25,6 +26,7 @@ object ModelProvider {
                     model.url = section.video.videoUrl
                     model.sectionId = section.id
                     model.cover = section.imgCover
+                    model.isLock = !paidStatus and (section.payType == 0)
                     list.add(model)
                 }
             }

+ 6 - 1
ui/src/main/kotlin/com/tencent/liteav/demo/player/PlayerActivity.kt

@@ -283,7 +283,11 @@ class PlayerActivity : AppCompatActivity(),
 
     override fun onPlayPrepare(index: Int, model: SuperPlayerModel) {
         if (viewModel.checkCanPlay()) {
-            mSuperPlayerView.playIndexModel(index)
+            if (model.isLock) {
+                Toast.makeText(this, "解锁课程后才可以观看~", Toast.LENGTH_SHORT).show()
+            } else {
+                mSuperPlayerView.playIndexModel(index)
+            }
         } else {
             Toast.makeText(this, "定时时间到了~", Toast.LENGTH_SHORT).show()
         }
@@ -291,6 +295,7 @@ class PlayerActivity : AppCompatActivity(),
 
     override fun onPlayIndex(index: Int, model: SuperPlayerModel) {
         launch {
+            mTextTitle.text = model.title
             mVodPlayerListAdapter.setIndex(index)
             mVodPlayerListView.smoothScrollToPosition(index)
         }