فهرست منبع

增加缩小播放按钮实验

xueyiming 4 ماه پیش
والد
کامیت
55c53a3806

+ 2 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/VideoDetail.java

@@ -23,6 +23,8 @@ public class VideoDetail {
 
     private String rawImgPath;
 
+    private String smallPlayImgPath;
+
     private String videoPath;
 
     private String videoOss;

+ 22 - 6
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CardServiceImpl.java

@@ -18,10 +18,7 @@ import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-import java.util.UUID;
+import java.util.*;
 
 @Slf4j
 @Service
@@ -46,7 +43,22 @@ public class CardServiceImpl implements CardService {
         add("20250304073234245880032");
     }};
 
-    private static final List<String> useShareImgPathList = new ArrayList<String>() ;
+    private static final List<String> useShareImgPathList = new ArrayList<String>();
+
+    private static final List<String> useSmallPlayImgPathList = new ArrayList<String>() {{
+        add("生活情感叁读");
+        add("缘来养心厅");
+        add("心灵情感驿站");
+        add("生活良读");
+        add("祝福养心厅");
+        add("音药金曲厅");
+        add("音药养心馆");
+        add("农耕趣时刻");
+        add("趣史论");
+        add("妙招持家帮手");
+        add("多彩妙生活");
+        add("史记趣言");
+    }};
 
 
     public JSONObject createGzhPath(String videoId, String sharedUid, String ghId, Integer miniProgramType) throws UnsupportedEncodingException {
@@ -129,8 +141,12 @@ public class CardServiceImpl implements CardService {
         publishMiniprogram.setSource(videoDetail.getSource());
         publishMiniprogram.setVideoTitle(videoDetail.getKimiTitle());
         if (crawlerImgPathList.contains(planAccount.getPlanId())
-                || useShareImgPathList.contains(planAccount.getAccountName())) {
+                || useShareImgPathList.contains(planAccount.getAccountName())
+                || useSmallPlayImgPathList.contains(planAccount.getAccountName())) {
             publishMiniprogram.setVideoCover(videoDetail.getShareImgPath());
+            if (useSmallPlayImgPathList.contains(planAccount.getAccountName())) {
+                publishMiniprogram.setVideoCover(videoDetail.getSmallPlayImgPath());
+            }
             if (crawlerImgPathList.contains(planAccount.getPlanId())) {
                 publishMiniprogram.setVideoCover(videoDetail.getRawImgPath());
             }

+ 8 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/VideoServiceImpl.java

@@ -107,12 +107,14 @@ public class VideoServiceImpl implements VideoService {
                 String id = list.get(0).getStr("id");
                 String shareImgPath = list.get(0).getStr("shareImgPath");
                 String coverImgPath = getCoverImgPath(shareImgPath);
+                String smallPlayImgPath = getSmallPlayImgPath(coverImgPath);
                 String videoPath = list.get(0).getStr("videoPath");
                 if (StringUtils.isNotEmpty(id)) {
                     videoDetail.setVideoId(id);
                 }
                 videoDetail.setShareImgPath(shareImgPath);
                 videoDetail.setCoverImgPath(coverImgPath);
+                videoDetail.setSmallPlayImgPath(smallPlayImgPath);
                 videoDetail.setVideoPath(videoPath);
             }
             return videoDetail;
@@ -122,7 +124,7 @@ public class VideoServiceImpl implements VideoService {
         return null;
     }
 
-    private String getCoverImgPath(String shareImgPath) {
+    private static String getCoverImgPath(String shareImgPath) {
         String[] split = shareImgPath.split("/");
         StringBuilder stringBuilder = new StringBuilder();
         for (String s : split) {
@@ -136,6 +138,11 @@ public class VideoServiceImpl implements VideoService {
         return stringBuilder.toString();
     }
 
+
+    private static String getSmallPlayImgPath(String coverImgPath) {
+        return coverImgPath + "/watermark,image_eXNoL3BpYy93YXRlcm1hcmtlci9pY29uX3BsYXlfd2hpdGUucG5nP3gtb3NzLXByb2Nlc3M9aW1hZ2UvcmVzaXplLHdfMzY=,g_center";
+    }
+
     @Override
     public void miniProgramVideoOff(String traceId) {
         try {