[Update]增加api支持TextureView播放直播
This commit is contained in:
@@ -4,6 +4,7 @@ import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.TextureView;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ToggleButton;
|
||||
@@ -38,7 +39,7 @@ public abstract class BaseLiveActivity extends AppCompatActivity {
|
||||
protected SurfaceView surfacePreviewView;
|
||||
|
||||
// 查看指定车机的画面
|
||||
protected SurfaceView surfacePlayView;
|
||||
protected TextureView textureView;
|
||||
// 查看直播按钮
|
||||
protected ToggleButton liveToggleBtn;
|
||||
// 登录第二个房间的按钮
|
||||
@@ -79,7 +80,7 @@ public abstract class BaseLiveActivity extends AppCompatActivity {
|
||||
|
||||
tvLiveStatus = findViewById(R.id.tvLiveStatus);
|
||||
|
||||
surfacePlayView = findViewById(R.id.surfacePlayView);
|
||||
textureView = findViewById(R.id.textureView);
|
||||
etLookRoomId = findViewById(R.id.etLookRoomId);
|
||||
liveToggleBtn = findViewById(R.id.liveToggleBtn);
|
||||
liveToggleBtn.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
|
||||
@@ -90,7 +90,7 @@ public class LivePlayAndPushActivity extends BaseLiveActivity
|
||||
public void togglePlay(boolean isPlay) {
|
||||
if (isPlay) {
|
||||
liveSn = etLookRoomId.getText().toString().trim();
|
||||
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(liveSn, surfacePlayView, this);
|
||||
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(liveSn, textureView, this);
|
||||
} else {
|
||||
MoGoAiCloudTrafficLive.stopCarLive(liveSn);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class LivePlayAndPushActivity extends BaseLiveActivity
|
||||
|
||||
@Override
|
||||
public void onFirstFrame() {
|
||||
surfacePlayView.setVisibility(View.VISIBLE);
|
||||
textureView.setVisibility(View.VISIBLE);
|
||||
Logger.d(TAG, "onFirstFrame");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user