调整播放器拉升问题5

This commit is contained in:
2023-01-09 16:20:54 +08:00
parent 93e2a8af02
commit cc4cc2f746
3 changed files with 19 additions and 6 deletions

View File

@@ -34,6 +34,7 @@ public class LiveExoPlayerManager {
private int playBufferIndex = 0;//卡顿计数器
private final Handler handler;
private static double log_buffer_time = 0, log_buffer_max_time;
private String url;
public LiveExoPlayerManager(Context mContext) {
DefaultLoadControl control = new DefaultLoadControl.Builder()
@@ -240,6 +241,7 @@ public class LiveExoPlayerManager {
*/
public void startUrl(String url) {
Log.i(TAG, "startUrl: " + url + " > " + mainView.getResizeMode());
this.url = url;
isSwitchUrl = true;
playBufferIndex = 0;
log_buffer_time = System.currentTimeMillis();
@@ -259,6 +261,7 @@ public class LiveExoPlayerManager {
*/
public void switchUrl(String url) {
Log.i(TAG, "switchUrl: " + url);
this.url = url;
playBufferIndex = 0;
isSwitchUrl = true;
log_buffer_time = System.currentTimeMillis();
@@ -317,4 +320,11 @@ public class LiveExoPlayerManager {
player1.release();
player2.release();
}
public String getUrl() {
if(url==null){
url="";
}
return url;
}
}