Skip to content

Commit

Permalink
Fix bug, update sdk.
Browse files Browse the repository at this point in the history
  • Loading branch information
borryzhang committed Nov 13, 2020
1 parent ffcc7e4 commit 95b151b
Show file tree
Hide file tree
Showing 106 changed files with 12,298 additions and 412 deletions.
2 changes: 1 addition & 1 deletion Demo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 10
versionName "7.9.607"
versionName "8.0.617"

multiDexEnabled true
ndk {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.tencent.liteav.demo.liveplayer.ui.LivePlayerEntranceActivity;
import com.tencent.liteav.demo.livepusher.camerapush.ui.CameraPushEntranceActivity;
import com.tencent.liteav.demo.liveroom.ui.LiveRoomActivity;
import com.tencent.liteav.demo.player.activity.SuperPlayerActivity;
import com.tencent.liteav.demo.player.demo.SuperPlayerActivity;
import com.tencent.liteav.demo.videoediter.TCVideoPickerActivity;
import com.tencent.liteav.demo.videojoiner.ui.TCVideoJoinChooseActivity;
import com.tencent.liteav.demo.videorecord.TCVideoSettingActivity;
Expand Down Expand Up @@ -65,7 +65,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);

mTvVersion = (TextView) findViewById(R.id.main_tv_version);
mTvVersion.setText("视频云工具包 v" + TXLiveBase.getSDKVersionStr()+"(7.9.607)");
mTvVersion.setText("视频云工具包 v" + TXLiveBase.getSDKVersionStr()+"(8.0.617)");

mMainTitle = (TextView) findViewById(R.id.main_title);
mMainTitle.setOnLongClickListener(new View.OnLongClickListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void navigationWebData() {
Intent intent = new Intent("com.tencent.liteav.action.WED_DATA");
intent.setData(data);
if (Build.VERSION.SDK_INT >= 26) {
ComponentName componentName = new ComponentName(getPackageName(), "com.tencent.liteav.demo.player.reveiver.WebDataReceiver");
ComponentName componentName = new ComponentName(getPackageName(), "com.tencent.liteav.demo.player.expand.webdata.reveiver.WebDataReceiver");
intent.setComponent(componentName);
}
Log.d(TAG, "navigationWebData: intent -> " + intent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


import com.tencent.liteav.demo.common.widget.expandableadapter.BaseExpandableRecyclerViewAdapter;
import com.tencent.liteav.demo.player.activity.SuperPlayerActivity;
import com.tencent.liteav.demo.player.demo.SuperPlayerActivity;
import com.tencent.rtmp.TXLiveBase;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,21 @@ public class BeautyPanel extends FrameLayout implements SeekBar.OnSeekBarChangeL
private int mCurrentTabPosition = 0;
private int[] mCurrentItemPosition;

public interface OnBeautyListener {
void onTabChange(TabInfo tabInfo, int position);
boolean onClose();
boolean onClick(TabInfo tabInfo, int tabPosition, ItemInfo itemInfo, int itemPosition);
boolean onLevelChanged(TabInfo tabInfo, int tabPosition, ItemInfo itemInfo, int itemPosition, int beautyLevel);
public abstract static class OnBeautyListener {
public void onTabChange(TabInfo tabInfo, int position) {
}

public boolean onClose() {
return true;
}

public boolean onClick(TabInfo tabInfo, int tabPosition, ItemInfo itemInfo, int itemPosition) {
return false;
}

public boolean onLevelChanged(TabInfo tabInfo, int tabPosition, ItemInfo itemInfo, int itemPosition, int beautyLevel) {
return false;
}
}

public BeautyPanel(@NonNull Context context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.tencent.liteav.demo.liveplayer.ui;

public class Constants {
/**
* 腾讯云直播拉流Demo提供的默认URL
*/
public static final String NORMAL_PLAY_URL = "http://liteavapp.qcloud.com/live/liteavdemoplayerstreamid.flv";

/**
* 腾讯云直播拉流文档URL
*/
public static final String LIVE_PLAYER_DOCUMENT_URL = "https://cloud.tencent.com/document/product/454/7886";

/**
* 腾讯云直播拉流超低时延播放文档URL
*/
public static final String LIVE_PLAYER_REAL_TIME_PLAY_DOCUMENT_URL = "https://cloud.tencent.com/document/product/454/7886#RealTimePlay";

/**
* 超低时延测试RTMP URL
*/
public static final String RTMP_ACC_TEST_URL = "https://lvb.qcloud.com/weapp/utils/get_test_rtmpaccurl";

/**
* MainActivity启动LivePlayerActivity时传递的Activity Type的KEY
*/
public static final String INTENT_ACTIVITY_TYPE = "TYPE";

/**
* QRCodeScanActivity完成扫描后,传递过来的结果的KEY
*/
public static final String INTENT_SCAN_RESULT = "SCAN_RESULT";

/**
* LivePlayerURLActivity设置页面传递给LivePlayerActivity的直播地址
*/
public static final String INTENT_URL = "intent_url";

public static final String URL_PREFIX_HTTP = "http://";
public static final String URL_PREFIX_HTTPS = "https://";
public static final String URL_PREFIX_RTMP = "rtmp://";
public static final String URL_SUFFIX_FLV = ".flv";
public static final String URL_TX_SECRET = "txSecret";
public static final String URL_BIZID = "bizid"; //是否为低延迟拉流地址


public static final int ACTIVITY_TYPE_LIVE_PLAY = 1; // 标准直播播放
public static final int ACTIVITY_TYPE_REALTIME_PLAY = 2; // 低延时直播播放

public static final float CACHE_TIME_FAST = 1.0f;
public static final float CACHE_TIME_SMOOTH = 5.0f;

public static final int CACHE_STRATEGY_FAST = 0; //极速
public static final int CACHE_STRATEGY_SMOOTH = 1; //流畅
public static final int CACHE_STRATEGY_AUTO = 2; //自动

public static final int PLAY_STATUS_SUCCESS = 0;
public static final int PLAY_STATUS_EMPTY_URL = -1;
public static final int PLAY_STATUS_INVALID_URL = -2;
public static final int PLAY_STATUS_INVALID_PLAY_TYPE = -3;
public static final int PLAY_STATUS_INVALID_RTMP_URL = -4;
public static final int PLAY_STATUS_INVALID_SECRET_RTMP_URL = -5;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import android.widget.Toast;

import com.tencent.liteav.demo.liveplayer.R;
import com.tencent.liteav.demo.liveplayer.model.Constants;

/**
* 直播拉流入口页面,主要用于获取拉流地址
Expand Down Expand Up @@ -90,6 +89,20 @@ public void onClick(View view) {
} else {
startLivePlayer(url);
}
} else if (id == R.id.liveplayer_btn_realtime_play) {
String url = mEditInputURL.getText().toString().trim();
if (TextUtils.isEmpty(url)) {
Toast.makeText(mContext, R.string.liveplayer_intpu_url, Toast.LENGTH_LONG).show();
} else {
boolean isLiveRTMP = url.startsWith(Constants.URL_PREFIX_RTMP);
boolean hasBizid = url.contains(Constants.URL_BIZID);
// "rtmp://" 开头且包含关键字 "bizid" 才认为是低延迟拉流地址
if (isLiveRTMP && hasBizid) {
startLivePlayer(url, true);
} else {
Toast.makeText(mContext, R.string.liveplayer_not_realtime_url, Toast.LENGTH_LONG).show();
}
}
}
}

Expand Down
Loading

0 comments on commit 95b151b

Please sign in to comment.