修改OnLive模块直播地址

修改OnLive模块直播地址
pull/107/head
xufulong 5 years ago
parent d80cbd80e8
commit a7c20b7700
  1. 20
      OnLive/src/main/AndroidManifest.xml
  2. 20
      OnLive/src/main/java/com/frank/living/activity/MultiScreenActivity.java
  3. 16
      OnLive/src/main/java/com/frank/living/activity/RtspLiveActivity.java

@ -18,11 +18,11 @@
android:label="@string/app_name" android:label="@string/app_name"
android:screenOrientation="landscape" android:screenOrientation="landscape"
android:theme="@style/FullscreenTheme"> android:theme="@style/FullscreenTheme">
<!--<intent-filter>--> <intent-filter>
<!--<action android:name="android.intent.action.MAIN" />--> <action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<!--<category android:name="android.intent.category.LAUNCHER" />--> <category android:name="android.intent.category.LAUNCHER" />
<!--</intent-filter>--> </intent-filter>
</activity> </activity>
<activity <activity
@ -31,11 +31,11 @@
android:label="@string/app_name" android:label="@string/app_name"
android:screenOrientation="landscape" android:screenOrientation="landscape"
android:theme="@style/FullscreenTheme"> android:theme="@style/FullscreenTheme">
<intent-filter> <!--<intent-filter>-->
<action android:name="android.intent.action.MAIN" /> <!--<action android:name="android.intent.action.MAIN" />-->
<action android:name="android.intent.action.VIEW" /> <!--<action android:name="android.intent.action.VIEW" />-->
<category android:name="android.intent.category.LAUNCHER" /> <!--<category android:name="android.intent.category.LAUNCHER" />-->
</intent-filter> <!--</intent-filter>-->
</activity> </activity>
</application> </application>

@ -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) {

@ -1,14 +1,19 @@
package com.frank.living.activity; package com.frank.living.activity;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.TableLayout; import android.widget.TableLayout;
import com.frank.living.R; import com.frank.living.R;
import com.frank.living.listener.IjkPlayerListener; import com.frank.living.listener.IjkPlayerListener;
import tv.danmaku.ijk.media.player.IjkMediaPlayer; import tv.danmaku.ijk.media.player.IjkMediaPlayer;
import com.frank.living.widget.IjkVideoView; import com.frank.living.widget.IjkVideoView;
public class RtspLiveActivity extends AppCompatActivity implements IjkPlayerListener, View.OnClickListener { public class RtspLiveActivity extends AppCompatActivity implements IjkPlayerListener, View.OnClickListener {
@ -22,7 +27,8 @@ public class RtspLiveActivity extends AppCompatActivity implements IjkPlayerList
private boolean isPause; private boolean isPause;
private boolean isSilence; private boolean isSilence;
private final static String url = "rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov"; // private final static String url = "rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov";
private final static String url = "rtmp://58.200.131.2:1935/livetv/hunantv";
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -37,16 +43,16 @@ public class RtspLiveActivity extends AppCompatActivity implements IjkPlayerList
IjkMediaPlayer.loadLibrariesOnce(null); IjkMediaPlayer.loadLibrariesOnce(null);
IjkMediaPlayer.native_profileBegin("libijkplayer.so"); IjkMediaPlayer.native_profileBegin("libijkplayer.so");
TableLayout mHudView = (TableLayout) findViewById(R.id.hud_view); TableLayout mHudView = findViewById(R.id.hud_view);
mVideoView = (IjkVideoView) findViewById(R.id.video_view); mVideoView = findViewById(R.id.video_view);
mVideoView.setHudView(mHudView); mVideoView.setHudView(mHudView);
mVideoView.setIjkPlayerListener(this); mVideoView.setIjkPlayerListener(this);
mVideoView.setVideoPath(url); mVideoView.setVideoPath(url);
mVideoView.start(); mVideoView.start();
btnPlay = (ImageButton) findViewById(R.id.btn_play); btnPlay = findViewById(R.id.btn_play);
btnPlay.setOnClickListener(this); btnPlay.setOnClickListener(this);
btnSound = (ImageButton) findViewById(R.id.btn_sound); btnSound = findViewById(R.id.btn_sound);
btnSound.setOnClickListener(this); btnSound.setOnClickListener(this);
} }

Loading…
Cancel
Save