|
|
@ -6,18 +6,23 @@ import android.content.Intent; |
|
|
|
import android.content.IntentFilter; |
|
|
|
import android.content.IntentFilter; |
|
|
|
import android.os.PowerManager; |
|
|
|
import android.os.PowerManager; |
|
|
|
import android.os.Process; |
|
|
|
import android.os.Process; |
|
|
|
|
|
|
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity; |
|
|
|
import androidx.appcompat.app.AppCompatActivity; |
|
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.text.TextUtils; |
|
|
|
import android.text.TextUtils; |
|
|
|
import android.util.Log; |
|
|
|
import android.util.Log; |
|
|
|
import android.view.View; |
|
|
|
import android.view.View; |
|
|
|
|
|
|
|
|
|
|
|
import com.frank.living.R; |
|
|
|
import com.frank.living.R; |
|
|
|
import com.frank.living.constant.Constants; |
|
|
|
import com.frank.living.constant.Constants; |
|
|
|
import com.frank.living.listener.OnDoubleClickListener; |
|
|
|
import com.frank.living.listener.OnDoubleClickListener; |
|
|
|
import com.frank.living.listener.IjkPlayerListener; |
|
|
|
import com.frank.living.listener.IjkPlayerListener; |
|
|
|
import com.frank.living.widget.IjkVideoView; |
|
|
|
import com.frank.living.widget.IjkVideoView; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.TreeMap; |
|
|
|
import java.util.TreeMap; |
|
|
|
|
|
|
|
|
|
|
|
import tv.danmaku.ijk.media.player.IMediaPlayer; |
|
|
|
import tv.danmaku.ijk.media.player.IMediaPlayer; |
|
|
|
import tv.danmaku.ijk.media.player.IjkMediaPlayer; |
|
|
|
import tv.danmaku.ijk.media.player.IjkMediaPlayer; |
|
|
|
|
|
|
|
|
|
|
@ -66,10 +71,10 @@ public class MultiScreenActivity extends AppCompatActivity{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initView() { |
|
|
|
private void initView() { |
|
|
|
mVideoView1 = (IjkVideoView) findViewById(R.id.video_view1); |
|
|
|
mVideoView1 = findViewById(R.id.video_view1); |
|
|
|
mVideoView2 = (IjkVideoView) findViewById(R.id.video_view2); |
|
|
|
mVideoView2 = findViewById(R.id.video_view2); |
|
|
|
mVideoView3 = (IjkVideoView) findViewById(R.id.video_view3); |
|
|
|
mVideoView3 = findViewById(R.id.video_view3); |
|
|
|
mVideoView4 = (IjkVideoView) findViewById(R.id.video_view4); |
|
|
|
mVideoView4 = findViewById(R.id.video_view4); |
|
|
|
|
|
|
|
|
|
|
|
divider1 = findViewById(R.id.divider1); |
|
|
|
divider1 = findViewById(R.id.divider1); |
|
|
|
divider2 = findViewById(R.id.divider2); |
|
|
|
divider2 = findViewById(R.id.divider2); |
|
|
@ -157,7 +162,6 @@ public class MultiScreenActivity extends AppCompatActivity{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 配置播放器参数项 |
|
|
|
* 配置播放器参数项 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void setOptions(IjkMediaPlayer ijkPlayer) { |
|
|
|
private void setOptions(IjkMediaPlayer ijkPlayer) { |
|
|
|
if (ijkPlayer == null) |
|
|
|
if (ijkPlayer == null) |
|
|
@ -253,6 +257,7 @@ public class MultiScreenActivity extends AppCompatActivity{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 选择空闲通道 |
|
|
|
* 选择空闲通道 |
|
|
|
|
|
|
|
* |
|
|
|
* @param clientNum clientNum |
|
|
|
* @param clientNum clientNum |
|
|
|
* @return idleChannel |
|
|
|
* @return idleChannel |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -267,6 +272,7 @@ public class MultiScreenActivity extends AppCompatActivity{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取当前投屏通道 |
|
|
|
* 获取当前投屏通道 |
|
|
|
|
|
|
|
* |
|
|
|
* @return idleChannel |
|
|
|
* @return idleChannel |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int getCastingChannel() { |
|
|
|
private int getCastingChannel() { |
|
|
@ -280,6 +286,7 @@ public class MultiScreenActivity extends AppCompatActivity{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 添加客户端 |
|
|
|
* 添加客户端 |
|
|
|
|
|
|
|
* |
|
|
|
* @param target target |
|
|
|
* @param target target |
|
|
|
* @param clientUrl clientUrl |
|
|
|
* @param clientUrl clientUrl |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -312,6 +319,7 @@ public class MultiScreenActivity extends AppCompatActivity{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 移除客户端 |
|
|
|
* 移除客户端 |
|
|
|
|
|
|
|
* |
|
|
|
* @param target target |
|
|
|
* @param target target |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void removeClient(int target) { |
|
|
|
private void removeClient(int target) { |
|
|
@ -355,6 +363,7 @@ public class MultiScreenActivity extends AppCompatActivity{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 进入全屏模式 |
|
|
|
* 进入全屏模式 |
|
|
|
|
|
|
|
* |
|
|
|
* @param channel channel |
|
|
|
* @param channel channel |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void enterFullScreen(int channel) { |
|
|
|
private void enterFullScreen(int channel) { |
|
|
@ -427,6 +436,7 @@ public class MultiScreenActivity extends AppCompatActivity{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 切换分屏模式 |
|
|
|
* 切换分屏模式 |
|
|
|
|
|
|
|
* |
|
|
|
* @param channel channel |
|
|
|
* @param channel channel |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void changeScreenMode(int channel) { |
|
|
|
private void changeScreenMode(int channel) { |
|
|
|