Skip to content

Commit

Permalink
Fix bug, update sdk.
Browse files Browse the repository at this point in the history
  • Loading branch information
garyxgwang committed Nov 3, 2021
1 parent 81af041 commit a4ca3ba
Show file tree
Hide file tree
Showing 76 changed files with 3,277 additions and 136 deletions.
6 changes: 2 additions & 4 deletions Demo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.tencent.liteav.demo"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 14
versionName "9.2.1029"
versionCode 24
versionName "9.3.1169"

multiDexEnabled true
ndk {
Expand Down Expand Up @@ -63,6 +63,4 @@ dependencies {
exclude group: 'com.google.code.gson', module: 'gson'
})

compile 'com.tencent.bugly:crashreport_upgrade:1.5.1'
compile 'com.tencent.bugly:nativecrashreport:3.8.0'
}
24 changes: 0 additions & 24 deletions Demo/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,3 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class com.tencent.** { *; }

-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}

-keep public class * extends com.qq.taf.jce.JceStruct{*;}

#wup的协议包:
-keep public class com.qq.jce.*{
public * ;
protected * ;
}

#native jni接口
-keepclasseswithmembernames class * {
native <methods>;
}

#native 回调接口
-keep public interface com.tencent.feedback.eup.jni.NativeExceptionHandler{
*;
}
-keep public class com.tencent.feedback.eup.jni.NativeExceptionUpload{
*;
}
66 changes: 66 additions & 0 deletions Demo/app/src/main/assets/153307-yc.lrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[00:00.00]北京欢迎你
[00:02.96]作词:林夕 作曲:小柯
[00:03.65]演唱:群星
[00:05.96]
[00:13.88](陈天佳)迎接另一个晨曦 带来全新空气
[00:19.66](刘欢)气息改变情味不变 茶香飘满情谊
[00:25.71](那英)我家大门常打开 开放怀抱等你
[00:31.82](孙燕姿)拥抱过就有了默契 你会爱上这里
[00:38.04](孙悦)不管远近都是客人 请不用客气
[00:43.79](王力宏)相约好了再一起 我们欢迎你
[00:50.14](韩红)我家种着万年青 开放每段传奇
[00:55.92](周华健)为传统的土壤播种 为你留下回忆
[01:02.31](梁咏琪)陌生熟悉都是客人 请不用拘礼
[01:08.13](羽泉)第几次来没关系 有太多话题
[01:15.86](成龙)北京欢迎你 为你开天辟地
[01:22.54](任贤齐)流动中的魅力充满着朝气
[01:28.77](蔡依林)北京欢迎你 在太阳下分享呼吸
[01:35.14](孙楠)在黄土地刷新成绩
[01:40.43]
[02:05.36](周笔畅)我家大门常打开 开怀容纳天地
[02:11.71](韦唯)岁月绽放青春笑容 迎接这个日期
[02:17.76](黄晓明)天大地大都是朋友 请不用客气
[02:23.72](韩庚)画意诗情带笑意 只为等待你
[02:29.34](汪峰)北京欢迎你 像音乐感动你
[02:35.36](莫文蔚)让我们都加油去超越自己
[02:41.51](谭晶)北京欢迎你 有梦想谁都了不起
[02:48.02](陈奕迅)有勇气就会有奇迹
[02:53.87](阎维文)北京欢迎你 为你开天辟地
[02:59.69](戴玉强)流动中的魅力充满着朝气
[03:05.84](王霞.李双松)北京欢迎你 在太阳下分享呼吸
[03:12.26](廖昌永)在黄土地刷新成绩
[03:18.17](林依轮)北京欢迎你 像音乐感动你
[03:23.96](张娜拉)让我们都加油去超越自己
[03:29.78](林俊杰)北京欢迎你 有梦想谁都了不起
[03:36.60](阿杜)有勇气就会有奇迹
[03:41.74](京剧) 北京欢迎你呀
[03:49.33](容祖儿)我家大门常打开 开放怀抱等你
[03:55.11](李宇春)拥抱过就有了默契 你会爱上这里
[04:01.38](黄大炜)不管远近都是客人 请不用客气
[04:07.34](陈坤)相约好了再一起 我们欢迎你
[04:12.96](谢霆锋)北京欢迎你 为你开天辟地
[04:18.74](韩磊)流动中的魅力充满着朝气
[04:24.89](徐若瑄)北京欢迎你 在太阳下分享呼吸
[04:31.32](费翔)在黄土地刷新成绩
[04:36.61]
[05:02.12](汤灿)我家大门常打开 开怀容纳天地
[05:08.22](林志玲 张梓琳)岁月绽放青春笑容 迎接这个日期
[05:14.18](张靓颖)天大地大都是朋友 请不用客气
[05:20.25](许茹芸 伍思凯)画意诗情带笑意 只为等待你
[05:25.92](杨坤.范玮琪)北京欢迎你 像音乐感动你
[05:31.55](游鸿明.周晓欧)让我们都加油去超越自己
[05:37.80](沙宝亮.满文军)北京欢迎你 有梦想谁都了不起
[05:44.32](金海心.何润东)有勇气就会有奇迹
[05:50.18](飞儿.庞龙)北京欢迎你 为你开天辟地
[05:55.92](吴克群.齐峰)流动中的魅力充满着朝气
[06:02.18](5566.胡彦斌)北京欢迎你 在太阳下分享呼吸
[06:08.59](郑希怡.刀郎)在黄土地刷新成绩
[06:14.46](纪敏 屠洪刚 吴彤)北京欢迎你 像音乐感动你
[06:20.27](郭容 刘耕宏 腾格尔)让我们都加油去超越自己
[06:26.61](金莎 苏醒 韦嘉)北京欢迎你 有梦想谁都了不起
[06:33.06](付丽珊 黄征 房祖明)有勇气就会有奇迹
[06:39.04](全体)北京欢迎你 有梦想谁都了不起
[06:45.14](全体)有勇气就会有奇迹
[06:50.87](全体)北京欢迎你 有梦想谁都了不起
[06:57.13](全体)有勇气就会有奇迹
[07:13.08]
Binary file added Demo/app/src/main/assets/153307-yc.mp3
Binary file not shown.
80 changes: 13 additions & 67 deletions Demo/app/src/main/java/com/tencent/liteav/demo/DemoApplication.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
package com.tencent.liteav.demo;

import android.app.ApplicationErrorReport;
import android.content.Context;
import android.os.Build;
import android.os.StrictMode;

import androidx.multidex.MultiDexApplication;
import android.util.Log;

import com.tencent.bugly.Bugly;
import com.tencent.bugly.beta.Beta;
import com.tencent.bugly.beta.download.DownloadListener;
import com.tencent.bugly.beta.download.DownloadTask;
import com.tencent.bugly.beta.upgrade.UpgradeStateListener;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.rtmp.TXLiveBase;
import com.tencent.rtmp.TXLiveBaseListener;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class DemoApplication extends MultiDexApplication {
private static String TAG = "DemoApplication";
private static final String BUGLY_APPID = ""; //配置bugly组件的appId
private static final String BUGLY_APP_CHANNEL = ""; // 配置bugly组件的APP渠道号
private static final boolean BUGLY_ENABLE_DEBUG = true; //配置bugly组件的调试模式(true或者false)
private static String TAG = "DemoApplication";

// private RefWatcher mRefWatcher;
private static DemoApplication instance;
Expand All @@ -41,9 +32,17 @@ public void onCreate() {
mAppContext = this.getApplicationContext();
instance = this;

TXLiveBase.setConsoleEnabled(true);
initBugly();

TXLiveBase.getInstance().setLicence(instance, licenceUrl, licenseKey);
TXLiveBase.setListener(new TXLiveBaseListener() {
@Override
public void onUpdateNetworkTime(int errCode, String errMsg) {
if (errCode != 0) {
TXLiveBase.updateNetworkTime();
}
}
});
TXLiveBase.updateNetworkTime();

// 短视频licence设置
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
Expand Down Expand Up @@ -78,57 +77,4 @@ private void closeAndroidPDialog() {
e.printStackTrace();
}
}

//配置bugly组件的APP ID,bugly组件为腾讯提供的用于crash上报,分析和升级的开放组件,如果您不需要该组件,可以自行移除
private void initBugly() {
CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(getApplicationContext());
strategy.setAppVersion(TXLiveBase.getSDKVersionStr());
strategy.setAppChannel(BUGLY_APP_CHANNEL);
//监听安装包下载状态
Beta.downloadListener = new DownloadListener() {
@Override
public void onReceive(DownloadTask downloadTask) {
}

@Override
public void onCompleted(DownloadTask downloadTask) {
Log.d(TAG, "downloadListener download apk file success");
}

@Override
public void onFailed(DownloadTask downloadTask, int i, String s) {
Log.d(TAG, "downloadListener download apk file fail");
}
};

//监听APP升级状态
Beta.upgradeStateListener = new UpgradeStateListener() {
@Override
public void onUpgradeFailed(boolean b) {
Log.d(TAG, "upgradeStateListener upgrade failed");
}

@Override
public void onUpgradeSuccess(boolean b) {
Log.d(TAG, "upgradeStateListener upgrade success");
}

@Override
public void onUpgradeNoVersion(boolean b) {
Log.d(TAG, "upgradeStateListener upgrade has no new version");
}

@Override
public void onUpgrading(boolean b) {
Log.d(TAG, "upgradeStateListener upgrading");
}

@Override
public void onDownloadCompleted(boolean b) {
Log.d(TAG, "upgradeStateListener download apk file success");
}
};
Bugly.init(getApplicationContext(), BUGLY_APPID, BUGLY_ENABLE_DEBUG, strategy);
}

}
30 changes: 16 additions & 14 deletions Demo/app/src/main/java/com/tencent/liteav/demo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.tencent.liteav.demo.common.widget.expandableadapter.BaseExpandableRecyclerViewAdapter;
import com.tencent.liteav.demo.player.demo.SuperPlayerActivity;
import com.tencent.liteav.demo.player.demo.shortvideo.view.ShortVideoActivity;
import com.tencent.rtmp.TXLiveBase;

import java.io.File;
Expand All @@ -34,9 +35,9 @@
public class MainActivity extends Activity {
private static final String TAG = "MainActivity";

private TextView mMainTitle;
private TextView mTvVersion;
private RecyclerView mRvList;
private TextView mMainTitle;
private TextView mTvVersion;
private RecyclerView mRvList;
private MainExpandableAdapter mAdapter;

@Override
Expand All @@ -52,7 +53,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);

mTvVersion = (TextView) findViewById(R.id.main_tv_version);
mTvVersion.setText(getString(R.string.app_tv_super_player_version, TXLiveBase.getSDKVersionStr()+"(9.2.1029)"));
mTvVersion.setText(getString(R.string.app_tv_super_player_version, TXLiveBase.getSDKVersionStr()+"(9.3.1169)"));

mMainTitle = (TextView) findViewById(R.id.main_title);
mMainTitle.setOnLongClickListener(new View.OnLongClickListener() {
Expand Down Expand Up @@ -137,6 +138,7 @@ private List<GroupBean> initGroupData() {
// 初始化播放器
List<ChildBean> playerChildList = new ArrayList<>();
playerChildList.add(new ChildBean(getString(R.string.app_item_super_player), R.drawable.play, 3, SuperPlayerActivity.class));
playerChildList.add(new ChildBean(getString(R.string.app_item_shortvideo_player), R.drawable.play, 3, ShortVideoActivity.class));
if (playerChildList.size() != 0) {
GroupBean playerGroupBean = new GroupBean(getString(R.string.app_item_player), R.drawable.composite, playerChildList);
groupList.add(playerGroupBean);
Expand All @@ -148,7 +150,7 @@ private List<GroupBean> initGroupData() {

private static class MainExpandableAdapter extends BaseExpandableRecyclerViewAdapter<GroupBean, ChildBean, GroupVH, ChildVH> {
private List<GroupBean> mListGroupBean;
private GroupBean mGroupBean;
private GroupBean mGroupBean;

public void setSelectedChildBean(GroupBean groupBean) {
boolean isExpand = isExpand(groupBean);
Expand Down Expand Up @@ -222,7 +224,7 @@ public void onBindChildViewHolder(ChildVH holder, GroupBean groupBean, ChildBean

public static class GroupVH extends BaseExpandableRecyclerViewAdapter.BaseGroupViewHolder {
ImageView ivLogo;
TextView textView;
TextView textView;

GroupVH(View itemView) {
super(itemView);
Expand All @@ -238,7 +240,7 @@ protected void onExpandStatusChanged(RecyclerView.Adapter relatedAdapter, boolea

public static class ChildVH extends RecyclerView.ViewHolder {
TextView textView;
View divideView;
View divideView;

ChildVH(View itemView) {
super(itemView);
Expand All @@ -249,9 +251,9 @@ public static class ChildVH extends RecyclerView.ViewHolder {
}

private class GroupBean implements BaseExpandableRecyclerViewAdapter.BaseGroupBean<ChildBean> {
private String mName;
private String mName;
private List<ChildBean> mChildList;
private int mIconId;
private int mIconId;

public GroupBean(String name, int iconId, List<ChildBean> list) {
mName = name;
Expand Down Expand Up @@ -289,9 +291,9 @@ public int getIconId() {

private class ChildBean {
public String mName;
public int mIconId;
public Class mTargetClass;
public int mType;
public int mIconId;
public Class mTargetClass;
public int mType;

public ChildBean(String name, int iconId, int type, Class targetActivityClass) {
this.mName = name;
Expand Down
2 changes: 2 additions & 0 deletions Demo/app/src/main/res/layout/app_activity_my_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
android:id="@+id/tv_show_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="300dp"
android:singleLine="true"
android:layout_marginTop="10dp"
android:textColor="@color/app_color_white"
android:textSize="18sp"
Expand Down
1 change: 1 addition & 0 deletions Demo/app/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<string name="app_item_mlvb">MLVB</string>

<string name="app_item_super_player">Superplayer</string>
<string name="app_item_shortvideo_player">Short Video Player</string>
<string name="app_item_player">Player</string>

<string name="app_item_video_recording">Shooting</string>
Expand Down
1 change: 1 addition & 0 deletions Demo/app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<string name="app_item_super_player">超级播放器</string>
<string name="app_item_player">播放器</string>
<string name="app_item_shortvideo_player">短视频播放</string>

<string name="app_item_video_recording">视频录制</string>
<string name="app_item_effects_editor">特效编辑</string>
Expand Down
1 change: 1 addition & 0 deletions Demo/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<string name="app_item_super_player">超级播放器</string>
<string name="app_item_player">播放器</string>
<string name="app_item_shortvideo_player">短视频播放</string>

<string name="app_item_video_recording">视频录制</string>
<string name="app_item_effects_editor">特效编辑</string>
Expand Down
1 change: 1 addition & 0 deletions Demo/superplayerdemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies {
compile 'com.squareup.okhttp3:okhttp:3.11.0'
compile 'androidx.multidex:multidex:2.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'androidx.cardview:cardview:1.0.0'
compile 'com.google.code.gson:gson:2.3.1'
compile('com.blankj:utilcode:1.25.9', {
exclude group: 'com.google.code.gson', module: 'gson'
Expand Down
9 changes: 8 additions & 1 deletion Demo/superplayerdemo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity android:name=".demo.shortvideo.base.AbsBaseActivity"/>
<activity android:name=".demo.shortvideo.view.ShortVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
/>
<activity
android:name=".demo.QRCodeScanActivity"
android:screenOrientation="portrait" />
Expand Down
Loading

0 comments on commit a4ca3ba

Please sign in to comment.