Commit 0ab4cfa5 authored by zhangww's avatar zhangww
Browse files

3.15.4

1.进行了部分的优化
parent 17711e83
......@@ -39,7 +39,7 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//获得场景视频SDK,必须引入
implementation 'com.bokecc:CCVOD:3.15.3'
implementation 'com.bokecc:CCVOD:3.15.4'
//播放加密视频必须引用drm
implementation 'com.bokecc:drm:1.2.1'
//使用DWIjkMediaPlayer 倍速播放器引入
......
......@@ -3,14 +3,13 @@ package com.bokecc.vod;
/**
* ConfigUtil
*
* @author xxx
* @author HuodeSence
*/
public class ConfigUtil {
/**
* 账号ID 可以替换为自己的USER_ID
* 391E6E3340A00767
*/
public static final String USER_ID = "391E6E3340A00767";
/**
......@@ -21,7 +20,6 @@ public class ConfigUtil {
/**
* 获取视频信息的地址
*/
public final static String DATA_URL = "https://p.bokecc.com/demo/videoinfo.json";
/**
......
......@@ -13,7 +13,6 @@ public class DataUtil {
*/
static String[] videoIds = new String[]{};
public static ArrayList<HuodeVideoInfo> getVideoList() {
ArrayList<HuodeVideoInfo> data = new ArrayList<>();
for (String videoId : videoIds) {
......
......@@ -2201,13 +2201,8 @@ public class MediaPlayActivity extends Activity implements View.OnClickListener,
String videoCover = videoInfo.getVideoCover();
//过滤掉本地已存在或正在下载中的文件,不重复下载
if (!VodDownloadManager.getInstance().isExistDownloadInfo(videoTitle) && !DataSet.hasDownloadInfo(videoTitle)) {
// DownloadConfig downloadConfig = new DownloadConfig(videoInfo.getVideoId(), verificationCode, videoTitle,
// 0, 0, videoCover, player.getSubtitleModel(), player.getMarqueeData());
//TODO for test
String marqueeData = "{\"loop\":-1,\"type\":\"text\",\"text\":{\"content\":\"测试跑马灯\",\"font_size\":30,\"color\":\"ffffffff\"},\"image\":{\"image_url\":\"http:\\/\\/abc.jpg\",\"width\":300,\"height\":22},\"action\":[{\"index\":0,\"duration\":30000,\"start\":{\"xpos\":0.312,\"ypos\":0.423,\"alpha\":0.8},\"end\":{\"xpos\":0.312,\"ypos\":0.823,\"alpha\":0.8}}]}\n";
DownloadConfig downloadConfig = new DownloadConfig(videoInfo.getVideoId(), verificationCode, videoTitle,
0, 0, videoCover, player.getSubtitleModel(),
marqueeData);
0, 0, videoCover, player.getSubtitleModel(), player.getMarqueeData());
downloadConfigs.add(downloadConfig);
downloadCount++;
if (!TextUtils.isEmpty(logoUrl)) {
......
......@@ -36,6 +36,7 @@ import android.os.IBinder;
import android.os.Message;
import android.os.Vibrator;
import android.support.annotation.Nullable;
import android.support.constraint.solver.widgets.Analyzer;
import android.text.TextUtils;
import android.util.Log;
import android.util.Rational;
......@@ -422,6 +423,10 @@ public class SpeedPlayActivity extends Activity implements View.OnClickListener,
private CustomLogoView clv_logo;
private String logoUrl = "";
private String logoPath;
/**
* 跑马灯数据
*/
private String marqueeData;
private float xPosRate = 0.1f, yPosRate = 0.1f, logoWidthRate = 0.1f, logoHeightRate = 0.1f;
@Override
......@@ -455,8 +460,7 @@ public class SpeedPlayActivity extends Activity implements View.OnClickListener,
format = getIntent().getStringExtra("format");
logoPath = getIntent().getStringExtra("logoPath");
isLocalPlay = getIntent().getBooleanExtra("isLocalPlay", false);
marqueeData = getIntent().getStringExtra("marqueeData");
iv_back = findViewById(R.id.iv_back);
iv_video_full_screen = findViewById(R.id.iv_video_full_screen);
iv_next_video = findViewById(R.id.iv_next_video);
......@@ -1149,42 +1153,8 @@ public class SpeedPlayActivity extends Activity implements View.OnClickListener,
tv_watch_tip.setText("可试看" + minute + "分钟" + second + "秒,购买会员查看完整版");
}
tv_pre_watch_over.setText(freeWatchOverMsg);
//设置跑马灯
if (marqueeInfo != null) {
String type = marqueeInfo.getType();
int loop = marqueeInfo.getLoop();
ArrayList<MarqueeAction> action = marqueeInfo.getAction();
mv_video.setLoop(loop);
mv_video.setMarqueeActions(action);
MarqueeInfo.TextBean textBean = marqueeInfo.getTextBean();
MarqueeInfo.ImageBean imageBean = marqueeInfo.getImageBean();
if (!TextUtils.isEmpty(type) && type.equals("text")) {
mv_video.setType(MarqueeView.TEXT);
if (textBean != null) {
String content = textBean.getContent();
if (!TextUtils.isEmpty(content)) {
mv_video.setTextContent(content);
}
int font_size = textBean.getFont_size();
mv_video.setTextFontSize(font_size);
String color = textBean.getColor();
if (!TextUtils.isEmpty(color) && color.length() == 8) {
String textColor = "#" + color.substring(2, 8);
if (textColor.length() == 7) {
//textColor:文字颜色,格式如:#ffffff
mv_video.setTextColor(textColor);
}
}
}
} else if (!TextUtils.isEmpty(type) && type.equals("image")) {
mv_video.setType(MarqueeView.IMAGE);
if (imageBean != null) {
mv_video.setMarqueeImage(activity, imageBean.getImage_url(), imageBean.getWidth(), imageBean.getHeight());
}
}
}
setMarqueeView(marqueeInfo);
}
});
}
......@@ -1230,6 +1200,11 @@ public class SpeedPlayActivity extends Activity implements View.OnClickListener,
sv_subtitle.initOfflineSubtitleSet(activity, subtitleSetPath);
}
}
//离线跑马灯数据
if (!TextUtils.isEmpty(marqueeData)) {
MarqueeInfo marqueeInfo = player.getMarqueeInfo(marqueeData);
setMarqueeView(marqueeInfo);
}
try {
player.setOfflineVideoPath(path, activity);
hideOnlineOperation();
......@@ -1269,6 +1244,42 @@ public class SpeedPlayActivity extends Activity implements View.OnClickListener,
}
private void setMarqueeView(MarqueeInfo marqueeInfo) {
if (marqueeInfo != null) {
String type = marqueeInfo.getType();
int loop = marqueeInfo.getLoop();
ArrayList<MarqueeAction> action = marqueeInfo.getAction();
mv_video.setLoop(loop);
mv_video.setMarqueeActions(action);
MarqueeInfo.TextBean textBean = marqueeInfo.getTextBean();
MarqueeInfo.ImageBean imageBean = marqueeInfo.getImageBean();
if (!TextUtils.isEmpty(type) && type.equals("text")) {
mv_video.setType(MarqueeView.TEXT);
if (textBean != null) {
String content = textBean.getContent();
if (!TextUtils.isEmpty(content)) {
mv_video.setTextContent(content);
}
int font_size = textBean.getFont_size();
mv_video.setTextFontSize(font_size);
String color = textBean.getColor();
if (!TextUtils.isEmpty(color) && color.length() == 8) {
String textColor = "#" + color.substring(2, 8);
if (textColor.length() == 7) {
//textColor:文字颜色,格式如:#ffffff
mv_video.setTextColor(textColor);
}
}
}
} else if (!TextUtils.isEmpty(type) && type.equals("image")) {
mv_video.setType(MarqueeView.IMAGE);
if (imageBean != null) {
mv_video.setMarqueeImage(activity, imageBean.getImage_url(), imageBean.getWidth(), imageBean.getHeight());
}
}
}
}
//获得广告信息
private void getAdInfo() {
if (netWorkStatus == 0) {
......
......@@ -224,8 +224,7 @@ public class MultiUtils {
}
public static String getVerificationCode() {
String verificationCode = HuodeApplication.getSp().getString("verificationCode", "");
return verificationCode;
return HuodeApplication.getSp().getString("verificationCode", "");
}
public static void setIsReadExerciseGuide(boolean isRead) {
......@@ -233,8 +232,7 @@ public class MultiUtils {
}
public static boolean getIsReadExerciseGuide() {
boolean isReadExerciseGuide = HuodeApplication.getSp().getBoolean("isReadExerciseGuide", false);
return isReadExerciseGuide;
return HuodeApplication.getSp().getBoolean("isReadExerciseGuide", false);
}
public static void setIsDynamicVideo(boolean isDynamicVideo) {
......@@ -242,8 +240,7 @@ public class MultiUtils {
}
public static boolean getIsDynamicVideo() {
boolean isDynamicVideo = HuodeApplication.getSp().getBoolean("isDynamicVideo", true);
return isDynamicVideo;
return HuodeApplication.getSp().getBoolean("isDynamicVideo", true);
}
// 获得输入框内容
......@@ -547,6 +544,8 @@ public class MultiUtils {
//wifi和移动数据同时连接
netWorkStatus = 3;
break;
default:
break;
}
}
......
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment