diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 4e3844e..526b4c2 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -1,5 +1,6 @@ + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 1f1f5e4..bce70e5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ android { defaultConfig { applicationId "net.spacen.xxh_video" - minSdk 21 + minSdk 19 targetSdk 31 versionCode 1 versionName "1.0" @@ -50,6 +50,9 @@ dependencies { implementation 'org.greenrobot:eventbus:3.1.1' + implementation 'com.kyleduo.switchbutton:library:2.0.0' + + //implementation 'com.github.MZCretin:AutoUpdateProject:latest_version' testImplementation 'junit:junit:4.+' diff --git a/app/src/androidTest/java/net/spacen/xxh_video/ExampleInstrumentedTest.java b/app/src/androidTest/java/net/spacen/xxh_video/ExampleInstrumentedTest.java index 8680161..25999b4 100644 --- a/app/src/androidTest/java/net/spacen/xxh_video/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/net/spacen/xxh_video/ExampleInstrumentedTest.java @@ -1,4 +1,4 @@ -package net.spacen.xxh_video; +package net.spacen.xxh-video; import android.content.Context; diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0566aaf..725bc62 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -56,6 +56,8 @@ + + diff --git a/app/src/main/java/net/spacen/xxh_video/CameraPushEntranceActivity.java b/app/src/main/java/net/spacen/xxh_video/CameraPushEntranceActivity.java new file mode 100644 index 0000000..4a4b4e3 --- /dev/null +++ b/app/src/main/java/net/spacen/xxh_video/CameraPushEntranceActivity.java @@ -0,0 +1,130 @@ +package net.spacen.xxh_video; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.KeyEvent; +import android.view.View; +import android.view.inputmethod.EditorInfo; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +/** + * 摄像头推流入口页面,主要用于生成推流地址 + */ +public class CameraPushEntranceActivity extends Activity { + + private static final int ACTIVITY_SCAN_REQUEST_CODE = 1; + private static final int REQUEST_CODE = 100; + + private Context mContext; + + private EditText mEditInputURL; + + @Override + protected void onCreate( Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + mContext = this; + setContentView(R.layout.livepusher_activity_live_pusher_entrance); + initViews(); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == ACTIVITY_SCAN_REQUEST_CODE && resultCode == RESULT_OK) { + String scanURL = data.getStringExtra(Constants.INTENT_SCAN_RESULT); + mEditInputURL.setText(scanURL); + startLivePusher(scanURL); + } + } + + private void initViews() { + mEditInputURL = findViewById(R.id.livepusher_et_input_url); + mEditInputURL.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + if (actionId == EditorInfo.IME_ACTION_GO || (event != null && event.getAction() == KeyEvent.ACTION_UP)) { + String url = mEditInputURL.getText().toString().trim(); + startLivePusher(url); + return true; + } + return false; + } + }); + findViewById(R.id.livepusher_ibtn_left).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); + } + }); + findViewById(R.id.livepusher_ibtn_right).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startQuestionLink(); + } + }); + } + + public void onClick(View view) { + int id = view.getId(); + if (id == R.id.livepusher_btn_normal_url) { + fetchPusherURL(); + } else if (id == R.id.livepusher_btn_qr_code_scan) { + // Intent intent = new Intent(mContext, QRCodeScanActivity.class); + // startActivityForResult(intent, ACTIVITY_SCAN_REQUEST_CODE); + } else if (id == R.id.livepusher_btn_play) { + String url = mEditInputURL.getText().toString().trim(); + startLivePusher(url); + } + } + + private void fetchPusherURL() { + + } + + private void startLivePusher(String pushURL) { + if (TextUtils.isEmpty(pushURL)) { + Toast.makeText(mContext, getString(R.string.livepusher_input_push_url), Toast.LENGTH_LONG).show(); + } else { + startLivePusher(pushURL, "", "", "", ""); + } + } + + private void startLivePusher(String pushURL, String rtmpPlayURL, String flvPlayURL, String hlsPlayURL, String realtimePlayURL) { + + /* + Intent intent = new Intent(mContext, CameraPushMainActivity.class); + intent.putExtra(Constants.INTENT_URL_PUSH, pushURL); + intent.putExtra(Constants.INTENT_URL_PLAY_RTMP, rtmpPlayURL); + intent.putExtra(Constants.INTENT_URL_PLAY_FLV, flvPlayURL); + intent.putExtra(Constants.INTENT_URL_PLAY_HLS, hlsPlayURL); + intent.putExtra(Constants.INTENT_URL_PLAY_ACC, realtimePlayURL); + startActivity(intent); + + */ + } + + private void startQuestionLink() { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(Constants.URL_PRODUCT_DOCUMENT)); + startActivity(intent); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/spacen/xxh_video/Constants.java b/app/src/main/java/net/spacen/xxh_video/Constants.java new file mode 100644 index 0000000..2cb3839 --- /dev/null +++ b/app/src/main/java/net/spacen/xxh_video/Constants.java @@ -0,0 +1,59 @@ +package net.spacen.xxh_video; + +public class Constants { + + public static final String URL_PRODUCT_DOCUMENT = "https://cloud.tencent.com/document/product/454/7885"; // 产品介绍链接 + public static final String URL_FETCH_PUSH_URL = "https://lvb.qcloud.com/weapp/utils/get_test_pushurl"; + + /** + * 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; + + /** + * LivePlayerURLActivity设置页面传递给LivePlayerActivity的直播地址 + */ + public static final String INTENT_URL_PUSH = "intent_url_push"; + public static final String INTENT_URL_PLAY_RTMP = "intent_url_play_rtmp"; + public static final String INTENT_URL_PLAY_FLV = "intent_url_play_flv"; + public static final String INTENT_URL_PLAY_HLS = "intent_url_play_hls"; + public static final String INTENT_URL_PLAY_ACC = "intent_url_play_acc"; + public static final String INTENT_URL_PLAY_RTC = "intent_url_play_rtc"; + + public static final String URL_PUSH = "url_push"; // RTMP 推流地址 + public static final String URL_PLAY_RTMP = "url_play_rtmp"; // RTMP 播放地址 + public static final String URL_PLAY_FLV = "url_play_flv"; // FLA 播放地址 + public static final String URL_PLAY_HLS = "url_play_hls"; // HLS 播放地址 + public static final String URL_PLAY_ACC = "url_play_acc"; // RTMP 加速流地址 + +} diff --git a/app/src/main/java/net/spacen/xxh_video/MainActivity.java b/app/src/main/java/net/spacen/xxh_video/MainActivity.java index f0dfbc9..6fb498e 100644 --- a/app/src/main/java/net/spacen/xxh_video/MainActivity.java +++ b/app/src/main/java/net/spacen/xxh_video/MainActivity.java @@ -1,16 +1,28 @@ package net.spacen.xxh_video; +import static com.tencent.live2.V2TXLiveCode.V2TXLIVE_ERROR_INVALID_PARAMETER; +import static com.tencent.live2.V2TXLiveCode.V2TXLIVE_OK; + import androidx.appcompat.app.AppCompatActivity; +import android.annotation.SuppressLint; import android.content.Context; +import android.content.Intent; import android.graphics.Bitmap; +import android.graphics.drawable.AnimationDrawable; import android.net.Uri; import android.os.Bundle; import android.provider.Settings; +import android.text.TextUtils; import android.util.Log; import android.view.SurfaceView; import android.view.View; import android.view.WindowManager; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; import android.widget.Toast; import android.widget.VideoView; @@ -18,6 +30,7 @@ import com.tencent.live2.V2TXLiveDef; import com.tencent.live2.V2TXLivePlayer; import com.tencent.live2.V2TXLivePlayerObserver; import com.tencent.live2.impl.V2TXLivePlayerImpl; +import com.tencent.rtmp.TXLiveBase; import com.tencent.rtmp.TXLiveConstants; import com.tencent.rtmp.TXLivePlayer; import com.tencent.rtmp.ui.TXCloudVideoView; @@ -26,16 +39,42 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import java.io.IOException; +import java.util.Timer; +import java.util.TimerTask; + import okhttp3.OkHttpClient; import tv.danmaku.ijk.media.player.IMediaPlayer; import tv.danmaku.ijk.media.player.IjkMediaPlayer; -public class MainActivity extends AppCompatActivity { +public class MainActivity extends AppCompatActivity implements View.OnClickListener { public final String TAG = MainActivity.class.getSimpleName(); private Context mContext; + private ImageView mImageLoading; //显示视频缓冲动画 + private RelativeLayout mLayoutRoot; //视频暂停时更新背景 + private LinearLayout mLayoutToolbar; //视频Tools + private RelativeLayout mliveplayer_title; + + + + + private ImageView mImageRoot; //背景icon + private ImageButton mButtonPlay; //视频的播放控制按钮 + private ImageButton mButtonRenderRotation; //调整视频播放方向:横屏、竖屏 + private ImageButton mButtonRenderMode; //调整视频渲染模式:全屏、自适应 + private ImageButton mButtonCacheStrategy; //设置视频的缓存策略 + private ImageView mImageCacheStrategyShadow; + private ImageButton mImageLogInfo; + + + //private RadioSelectView mLayoutCacheStrategy; //显示所有缓存模式的View + //private LogInfoWindow mLogInfoWindow; + + private int mLogClickCount = 0; + private V2TXLivePlayer mLivePlayer; //直播拉流的视频播放器 private TXCloudVideoView mVideoView; @@ -50,6 +89,12 @@ public class MainActivity extends AppCompatActivity { private OkHttpClient mOkHttpClient = null; //获取超低时延视频源直播地址 + private int mCacheStrategy = Constants.CACHE_STRATEGY_AUTO; //Player缓存策略 + private int mActivityPlayType = Constants.ACTIVITY_TYPE_LIVE_PLAY; //播放类型 + private V2TXLiveDef.V2TXLiveFillMode mRenderMode = V2TXLiveDef.V2TXLiveFillMode.V2TXLiveFillModeFit; //Player 当前渲染模式 + private V2TXLiveDef.V2TXLiveRotation mRenderRotation = V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation0; //Player 当前渲染角度 + + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -63,36 +108,135 @@ public class MainActivity extends AppCompatActivity { MyMqttService.startService(this); //开启服务 + //timer.schedule(task,0,10000); + + + String licenceURL = "https://license.vod2.myqcloud.com/license/v2/1304883579_1/v_cube.license"; // 获取到的 licence url + String licenceKey = "cd83b2d9f0570e9ab4b5059a3cf5ba36"; // 获取到的 licence key + TXLiveBase.getInstance().setLicence(this, licenceURL, licenceKey); + + EventBus.getDefault().register(this); + mContext = this; + + TextView t1 = (TextView) findViewById(R.id.liveplayer_title_textview); + t1.setText(getAndroidID()); + Toast.makeText(this, getAndroidID() + " 哈哈,我成功启动了!", Toast.LENGTH_LONG).show(); Log.e("AutoRun","哈哈,我成功启动了!"); + mPlayURL = "rtmp://v.dl8.tv/show/mini"; + //mPlayerView 即 step1 中添加的界面 view mVideoView = (TXCloudVideoView) findViewById(R.id.video_view); vv_view = (VideoView) findViewById(R.id.vv_view); + vv_view.setVisibility(View.GONE); + initialize(); + } - mContext = this; + @Override + public void onClick(View view) { + showToolbox(); + } + + private void hideToolbox() { + mLayoutToolbar.setVisibility(View.GONE); + mliveplayer_title.setVisibility(View.GONE); + } + private void showToolbox() { + + mLayoutToolbar.setVisibility(View.VISIBLE); + mliveplayer_title.setVisibility(View.VISIBLE); + + mLayoutToolbar.postDelayed(new Runnable() { + @Override + public void run() { + hideToolbox(); + }},10000); + } + + private void initialize() { + mLayoutRoot = (RelativeLayout) findViewById(R.id.liveplayer_rl_root); + mliveplayer_title = (RelativeLayout) findViewById(R.id.liveplayer_title); + + mImageRoot = (ImageView) findViewById(R.id.liveplayer_iv_root); + + mLayoutToolbar = (LinearLayout) findViewById(R.id.liveplayer_ll_menu_layout); + + + initPlayView(); + initPlayButton(); + initRenderRotationButton(); + initRenderModeButton(); + initCacheStrategyButton(); + //initNavigationBack(); + //initRTMPURL(); + + showToolbox(); + // 初始化完成之后自动播放 + startPlay(); + } + + private void initPlayView() { + mVideoView = (TXCloudVideoView) findViewById(R.id.video_view); + mVideoView.setLogMargin(12, 12, 110, 60); + mVideoView.showLog(false); + + mVideoView.setOnClickListener(this); + vv_view.setOnClickListener(this); - //创建 player 对象 mLivePlayer = new V2TXLivePlayerImpl(mContext); + mImageLoading = (ImageView) findViewById(R.id.liveplayer_iv_loading); + } - //关键 player 对象与界面 view - mLivePlayer.setRenderView(mVideoView); + private void initCacheStrategyButton() { - String flvUrl = "rtmp://v.dl8.tv/show/mini"; + //mLayoutCacheStrategy = (RadioSelectView) findViewById(R.id.liveplayer_rsv_cache_strategy); + mImageCacheStrategyShadow = (ImageView) findViewById(R.id.liveplayer_btn_cache_strategy_shadow); + mButtonCacheStrategy = (ImageButton) findViewById(R.id.liveplayer_btn_cache_strategy); + mButtonCacheStrategy.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(mContext, CameraPushEntranceActivity.class); +/* + intent.putExtra(Constants.INTENT_URL_PUSH, pushURL); + intent.putExtra(Constants.INTENT_URL_PLAY_RTMP, rtmpPlayURL); + intent.putExtra(Constants.INTENT_URL_PLAY_FLV, flvPlayURL); + intent.putExtra(Constants.INTENT_URL_PLAY_HLS, hlsPlayURL); + intent.putExtra(Constants.INTENT_URL_PLAY_ACC, realtimePlayURL); +*/ + startActivity(intent); + } + }); + } - //自动模式 - mLivePlayer.setCacheParams(1.0f, 5.0f); + private void startPlay() { + String playURL = mPlayURL; + int code = checkPlayURL(playURL); + if (code != Constants.PLAY_STATUS_SUCCESS) { + mIsPlaying = false; + } else { + mLivePlayer.setRenderView(mVideoView); + mLivePlayer.setObserver(new MyPlayerObserver()); - //极速模式 - //mLivePlayer.setCacheParams(1.0f, 1.0f); + mLivePlayer.setRenderRotation(mRenderRotation); + mLivePlayer.setRenderFillMode(mRenderMode); - //流畅模式 - //mLivePlayer.setCacheParams(5.0f, 5.0f); - //设置完成之后再启动播放 + mLivePlayer.setCacheParams(1.0f, 5.0f); - mLivePlayer.startPlay(flvUrl); + /** + * result返回值: + * 0 V2TXLIVE_OK; -2 V2TXLIVE_ERROR_INVALID_PARAMETER; -3 V2TXLIVE_ERROR_REFUSED; + */ + code = mLivePlayer.startPlay(playURL); + mIsPlaying = code == 0; + + Log.d("video render", "timetrack start play"); + } + + //处理UI相关操作 + onPlayStart(code); } @Override @@ -107,6 +251,20 @@ public class MainActivity extends AppCompatActivity { destroy(); } + private void startLoadingAnimation() { + if (mImageLoading != null) { + mImageLoading.setVisibility(View.VISIBLE); + ((AnimationDrawable) mImageLoading.getDrawable()).start(); + } + } + + private void stopLoadingAnimation() { + if (mImageLoading != null) { + mImageLoading.setVisibility(View.GONE); + ((AnimationDrawable) mImageLoading.getDrawable()).stop(); + } + } + private void stopPlay() { if (!mIsPlaying) { return; @@ -137,11 +295,11 @@ public class MainActivity extends AppCompatActivity { public void onPlayStop() { - // mButtonPlay.setBackgroundResource(R.drawable.liveplayer_play_start_btn); - // mLayoutRoot.setBackgroundResource(R.drawable.liveplayer_content_bg); - // mImageRoot.setVisibility(View.VISIBLE); + mButtonPlay.setBackgroundResource(R.drawable.liveplayer_play_start_btn); + mLayoutRoot.setBackgroundResource(R.drawable.liveplayer_content_bg); + mImageRoot.setVisibility(View.VISIBLE); // mLogInfoWindow.clear(); - // stopLoadingAnimation(); + stopLoadingAnimation(); } private class MyPlayerObserver extends V2TXLivePlayerObserver { @@ -235,6 +393,150 @@ public class MainActivity extends AppCompatActivity { } + + + private int checkPlayURL(final String playURL) { + if (TextUtils.isEmpty(playURL)) { + return Constants.PLAY_STATUS_EMPTY_URL; + } + + if (!playURL.startsWith(Constants.URL_PREFIX_HTTP) && !playURL.startsWith(Constants.URL_PREFIX_HTTPS) + && !playURL.startsWith(Constants.URL_PREFIX_RTMP) && !playURL.startsWith("/")) { + return Constants.PLAY_STATUS_INVALID_URL; + } + + boolean isLiveRTMP = playURL.startsWith(Constants.URL_PREFIX_RTMP); + boolean isLiveFLV = (playURL.startsWith(Constants.URL_PREFIX_HTTP) || playURL.startsWith(Constants.URL_PREFIX_HTTPS)) && playURL.contains(Constants.URL_SUFFIX_FLV); + + if (mActivityPlayType == Constants.ACTIVITY_TYPE_LIVE_PLAY) { + if (isLiveRTMP) { + return Constants.PLAY_STATUS_SUCCESS; + } + if (isLiveFLV) { + return Constants.PLAY_STATUS_SUCCESS; + } + return Constants.PLAY_STATUS_INVALID_URL; + } + + if (mActivityPlayType == Constants.ACTIVITY_TYPE_REALTIME_PLAY) { + if (!isLiveRTMP) { + return Constants.PLAY_STATUS_INVALID_RTMP_URL; + } + if (!playURL.contains(Constants.URL_TX_SECRET)) { + return Constants.PLAY_STATUS_INVALID_SECRET_RTMP_URL; + } + return Constants.PLAY_STATUS_SUCCESS; + } + return Constants.PLAY_STATUS_INVALID_URL; + } + + private void togglePlay() { + Log.d(TAG, "togglePlay: mIsPlaying:" + mIsPlaying + ", mCurrentPlayType:" + mActivityPlayType); + if (mIsPlaying) { + stopPlay(); + } else { + startPlay(); + } + } + + public void onPlayStart(int code) { + + /* + switch (code) { + case V2TXLIVE_OK: + startLoadingAnimation(); + break; + case V2TXLIVE_ERROR_INVALID_PARAMETER: + Toast.makeText(mContext, R.string.liveplayer_warning_res_url_invalid, Toast.LENGTH_SHORT).show(); + break; + default: + break; + } + if (code != V2TXLIVE_OK) { + mButtonPlay.setBackgroundResource(R.drawable.liveplayer_play_start_btn); + mLayoutRoot.setBackgroundResource(R.drawable.liveplayer_content_bg); + mImageRoot.setVisibility(View.VISIBLE); + Bundle params = new Bundle(); + params.putString(TXLiveConstants.EVT_DESCRIPTION, mContext.getResources().getString(R.string.liveplayer_warning_checkout_res_url)); + mLogInfoWindow.setLogText(null, params, LogInfoWindow.CHECK_RTMP_URL_FAIL); + } else { + mButtonPlay.setBackgroundResource(R.drawable.liveplayer_play_pause_btn); + mLayoutRoot.setBackgroundColor(getResources().getColor(R.color.liveplayer_black)); + mImageRoot.setVisibility(View.GONE); + Bundle params = new Bundle(); + params.putString(TXLiveConstants.EVT_DESCRIPTION, mContext.getResources().getString(R.string.liveplayer_warning_checkout_res_url)); + mLogInfoWindow.setLogText(null, params, LogInfoWindow.CHECK_RTMP_URL_OK); + } + + */ + } + + private void initPlayButton() { + mButtonPlay = (ImageButton) findViewById(R.id.liveplayer_btn_play); + mButtonPlay.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + togglePlay(); + } + }); + } + + private void initRenderRotationButton() { + mButtonRenderRotation = (ImageButton) findViewById(R.id.liveplayer_btn_render_rotate_landscape); + mButtonRenderRotation.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + V2TXLiveDef.V2TXLiveRotation renderRotation = getRenderRotation(); + if (renderRotation == V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation0) { + mButtonRenderRotation.setBackgroundResource(R.drawable.liveplayer_render_rotate_portrait); + renderRotation = V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation270; + } else if (renderRotation == V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation270) { + mButtonRenderRotation.setBackgroundResource(R.drawable.liveplayer_render_rotate_landscape); + renderRotation = V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation0; + } + setRenderRotation(renderRotation); + } + }); + } + + private void setRenderMode(V2TXLiveDef.V2TXLiveFillMode renderMode) { + mRenderMode = renderMode; + mLivePlayer.setRenderFillMode(renderMode); + } + + private V2TXLiveDef.V2TXLiveFillMode getRenderMode() { + return mRenderMode; + } + + private void setRenderRotation(V2TXLiveDef.V2TXLiveRotation renderRotation) { + mRenderRotation = renderRotation; + mLivePlayer.setRenderRotation(renderRotation); + } + private V2TXLiveDef.V2TXLiveRotation getRenderRotation() { + return mRenderRotation; + } + + + private void initRenderModeButton() { + mButtonRenderMode = (ImageButton) findViewById(R.id.liveplayer_btn_render_mode_fill); + mButtonRenderMode.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + V2TXLiveDef.V2TXLiveFillMode renderMode = getRenderMode(); + if (getRenderMode() == V2TXLiveDef.V2TXLiveFillMode.V2TXLiveFillModeFill) { + mButtonRenderMode.setBackgroundResource(R.drawable.liveplayer_render_mode_fill); + renderMode = V2TXLiveDef.V2TXLiveFillMode.V2TXLiveFillModeFit; + } else if (getRenderMode() == V2TXLiveDef.V2TXLiveFillMode.V2TXLiveFillModeFit) { + mButtonRenderMode.setBackgroundResource(R.drawable.liveplayer_adjust_mode_btn); + renderMode = V2TXLiveDef.V2TXLiveFillMode.V2TXLiveFillModeFill; + } + setRenderMode(renderMode); + } + }); + } + + + private String getAndroidID() { return Settings.Secure.getString( getContentResolver(), Settings.Secure.ANDROID_ID); @@ -243,15 +545,15 @@ public class MainActivity extends AppCompatActivity { @Subscribe(threadMode = ThreadMode.MAIN) public void onGetMessage(MessageWrap message) { // getBinding().tvMessage.setText(message.message); - Log.i(TAG, "收到消息: " + new String(message.message)); - Toast.makeText(getApplicationContext(), "EventBus: " + new String(message.message), Toast.LENGTH_LONG).show(); +// Log.i(TAG, "收到消息: " + new String(message.message)); +// Toast.makeText(getApplicationContext(), "EventBus: " + new String(message.message), Toast.LENGTH_LONG).show(); String url = new String(message.message); if (url.substring(url.length()-4).equals("m3u8")){ mLivePlayer.stopPlay(); mVideoView.setVisibility(View.GONE); - + vv_view.setVisibility(View.VISIBLE); vv_view.setVideoPath(url); vv_view.start(); diff --git a/app/src/main/java/net/spacen/xxh_video/MyMqttService.java b/app/src/main/java/net/spacen/xxh_video/MyMqttService.java index 38f1dde..29b4bf6 100644 --- a/app/src/main/java/net/spacen/xxh_video/MyMqttService.java +++ b/app/src/main/java/net/spacen/xxh_video/MyMqttService.java @@ -37,11 +37,11 @@ public class MyMqttService extends Service { private static MqttAndroidClient mqttAndroidClient; private MqttConnectOptions mMqttConnectOptions; - public String HOST = "tcp://mqtt.hulian100.cn:1883";//服务器地址(协议+地址+端口号) + public String HOST = "tcp://red.xinxinghang.cn:1883";//服务器地址(协议+地址+端口号) public String USERNAME = "admin";//用户名 public String PASSWORD = "password";//密码 - public static String PUBLISH_TOPIC = "/xxh/rtmp-video/";//发布主题 - public static String RESPONSE_TOPIC = "/xxh/rtmp-video/";//响应主题 + public static String PUBLISH_TOPIC = "/xxh/video/reg";//发布主题 + public static String RESPONSE_TOPIC = "/xxh/video/";//订阅主题 public static String CLIENTID = ""; @@ -68,6 +68,8 @@ public class MyMqttService extends Service { mContext.startService(new Intent(mContext, MyMqttService.class)); } + + /** * 发布 (模拟其他客户端发布消息) * @@ -85,6 +87,24 @@ public class MyMqttService extends Service { } } + + /** + * 发布 (模拟其他客户端发布消息) + * + * @param message 消息 + */ + public static void publish(String Topic,String message) { + String topic = PUBLISH_TOPIC; + Integer qos = 2; + Boolean retained = false; + try { + //参数分别为:主题、消息的字节数组、服务质量、是否在服务器保留断开连接后的最后一条消息 + mqttAndroidClient.publish(Topic, message.getBytes(), qos.intValue(), retained.booleanValue()); + } catch (MqttException e) { + e.printStackTrace(); + } + } + /** * 响应 (收到其他客户端的消息后,响应给对方告知消息已到达或者消息有问题等) * @@ -179,8 +199,16 @@ public class MyMqttService extends Service { @Override public void onSuccess(IMqttToken arg0) { Log.i(TAG, "连接成功 "); + + Integer qos = 2; + Boolean retained = false; + try { - mqttAndroidClient.subscribe(PUBLISH_TOPIC + CLIENTID, 2);//订阅主题,参数:主题、服务质量 + String message = "{\"terminal_uid\":\"" + CLIENTID + "\"}"; + + mqttAndroidClient.publish(PUBLISH_TOPIC, message.getBytes(), qos.intValue(), retained.booleanValue()); + + mqttAndroidClient.subscribe(RESPONSE_TOPIC + CLIENTID, 2);//订阅主题,参数:主题、服务质量 } catch (MqttException e) { e.printStackTrace(); } diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_acc.png b/app/src/main/res/drawable-xhdpi/liveplayer_acc.png new file mode 100644 index 0000000..d79d419 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_acc.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_adjust_mode_btn.png b/app/src/main/res/drawable-xhdpi/liveplayer_adjust_mode_btn.png new file mode 100644 index 0000000..bbcc85d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_adjust_mode_btn.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_bg_icon.png b/app/src/main/res/drawable-xhdpi/liveplayer_bg_icon.png new file mode 100644 index 0000000..090a259 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_bg_icon.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_cache_strategy.png b/app/src/main/res/drawable-xhdpi/liveplayer_cache_strategy.png new file mode 100644 index 0000000..a9428f7 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_cache_strategy.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_decode_btn.png b/app/src/main/res/drawable-xhdpi/liveplayer_decode_btn.png new file mode 100644 index 0000000..ceb0e9e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_decode_btn.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_ic_qcode.png b/app/src/main/res/drawable-xhdpi/liveplayer_ic_qcode.png new file mode 100644 index 0000000..b99b817 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_ic_qcode.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_log_info_btn_show.png b/app/src/main/res/drawable-xhdpi/liveplayer_log_info_btn_show.png new file mode 100644 index 0000000..daea268 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_log_info_btn_show.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_loginfo.9.png b/app/src/main/res/drawable-xhdpi/liveplayer_loginfo.9.png new file mode 100644 index 0000000..2b55836 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_loginfo.9.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_play_pause_btn.png b/app/src/main/res/drawable-xhdpi/liveplayer_play_pause_btn.png new file mode 100644 index 0000000..dee045a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_play_pause_btn.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_play_start_btn.png b/app/src/main/res/drawable-xhdpi/liveplayer_play_start_btn.png new file mode 100644 index 0000000..2e16604 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_play_start_btn.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_radio_btn_checked.png b/app/src/main/res/drawable-xhdpi/liveplayer_radio_btn_checked.png new file mode 100644 index 0000000..b987582 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_radio_btn_checked.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_render_mode_fill.png b/app/src/main/res/drawable-xhdpi/liveplayer_render_mode_fill.png new file mode 100644 index 0000000..e3424a9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_render_mode_fill.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_render_rotate_landscape.png b/app/src/main/res/drawable-xhdpi/liveplayer_render_rotate_landscape.png new file mode 100644 index 0000000..93ff5eb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_render_rotate_landscape.png differ diff --git a/app/src/main/res/drawable-xhdpi/liveplayer_render_rotate_portrait.png b/app/src/main/res/drawable-xhdpi/liveplayer_render_rotate_portrait.png new file mode 100644 index 0000000..bfea203 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/liveplayer_render_rotate_portrait.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_bg_icon.png b/app/src/main/res/drawable-xhdpi/livepusher_bg_icon.png new file mode 100644 index 0000000..090a259 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_bg_icon.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_bgm.png b/app/src/main/res/drawable-xhdpi/livepusher_bgm.png new file mode 100644 index 0000000..8e990dc Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_bgm.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_camera_back_btn.png b/app/src/main/res/drawable-xhdpi/livepusher_camera_back_btn.png new file mode 100644 index 0000000..30660eb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_camera_back_btn.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_camera_front.png b/app/src/main/res/drawable-xhdpi/livepusher_camera_front.png new file mode 100644 index 0000000..cc52e93 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_camera_front.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_copy.png b/app/src/main/res/drawable-xhdpi/livepusher_copy.png new file mode 100644 index 0000000..a7ce7d6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_copy.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_green.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_green.png new file mode 100644 index 0000000..7abdd3e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_green.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed0.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed0.png new file mode 100644 index 0000000..067c9ec Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed0.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed1.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed1.png new file mode 100644 index 0000000..3f44e7b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed1.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed2.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed2.png new file mode 100644 index 0000000..bcce844 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed2.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed3.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed3.png new file mode 100644 index 0000000..55a868d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed3.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed4.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed4.png new file mode 100644 index 0000000..7ab7188 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed4.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed5.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed5.png new file mode 100644 index 0000000..e2e720b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_net_speed5.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_qcode.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_qcode.png new file mode 100644 index 0000000..b99b817 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_qcode.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_ic_red.png b/app/src/main/res/drawable-xhdpi/livepusher_ic_red.png new file mode 100644 index 0000000..e822219 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_ic_red.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loading_image0.png b/app/src/main/res/drawable-xhdpi/livepusher_loading_image0.png new file mode 100644 index 0000000..752ad96 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loading_image0.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loading_image1.png b/app/src/main/res/drawable-xhdpi/livepusher_loading_image1.png new file mode 100644 index 0000000..4a486a5 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loading_image1.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loading_image2.png b/app/src/main/res/drawable-xhdpi/livepusher_loading_image2.png new file mode 100644 index 0000000..18e2e46 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loading_image2.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loading_image3.png b/app/src/main/res/drawable-xhdpi/livepusher_loading_image3.png new file mode 100644 index 0000000..c8fd81f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loading_image3.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loading_image4.png b/app/src/main/res/drawable-xhdpi/livepusher_loading_image4.png new file mode 100644 index 0000000..06327aa Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loading_image4.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loading_image5.png b/app/src/main/res/drawable-xhdpi/livepusher_loading_image5.png new file mode 100644 index 0000000..bedd3f9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loading_image5.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loading_image6.png b/app/src/main/res/drawable-xhdpi/livepusher_loading_image6.png new file mode 100644 index 0000000..24ed320 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loading_image6.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loading_image7.png b/app/src/main/res/drawable-xhdpi/livepusher_loading_image7.png new file mode 100644 index 0000000..8171db0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loading_image7.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_loginfo.png b/app/src/main/res/drawable-xhdpi/livepusher_loginfo.png new file mode 100644 index 0000000..e67a772 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_loginfo.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_lvb_beauty.png b/app/src/main/res/drawable-xhdpi/livepusher_lvb_beauty.png new file mode 100644 index 0000000..b0d98db Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_lvb_beauty.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_more.png b/app/src/main/res/drawable-xhdpi/livepusher_more.png new file mode 100644 index 0000000..76c79ab Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_more.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_pause.png b/app/src/main/res/drawable-xhdpi/livepusher_pause.png new file mode 100644 index 0000000..dee045a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_pause.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_pause_publish.jpg b/app/src/main/res/drawable-xhdpi/livepusher_pause_publish.jpg new file mode 100644 index 0000000..4537438 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_pause_publish.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_qr_code_btn.png b/app/src/main/res/drawable-xhdpi/livepusher_qr_code_btn.png new file mode 100644 index 0000000..9993d3d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_qr_code_btn.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_radio_btn_checked.png b/app/src/main/res/drawable-xhdpi/livepusher_radio_btn_checked.png new file mode 100644 index 0000000..b987582 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_radio_btn_checked.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_role.png b/app/src/main/res/drawable-xhdpi/livepusher_role.png new file mode 100644 index 0000000..9df5ce7 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_role.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_start.png b/app/src/main/res/drawable-xhdpi/livepusher_start.png new file mode 100644 index 0000000..2e16604 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_start.png differ diff --git a/app/src/main/res/drawable-xhdpi/livepusher_watermark.png b/app/src/main/res/drawable-xhdpi/livepusher_watermark.png new file mode 100755 index 0000000..0c9f2c2 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/livepusher_watermark.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_bg_icon.png b/app/src/main/res/drawable-xxhdpi/liveplayer_bg_icon.png new file mode 100644 index 0000000..f0d574d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_bg_icon.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_btn_bg.xml b/app/src/main/res/drawable-xxhdpi/liveplayer_btn_bg.xml new file mode 100644 index 0000000..b729361 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/liveplayer_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_content_bg.xml b/app/src/main/res/drawable-xxhdpi/liveplayer_content_bg.xml new file mode 100644 index 0000000..81646c5 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/liveplayer_content_bg.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_back.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_back.png new file mode 100644 index 0000000..3d05499 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_back.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed0.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed0.png new file mode 100644 index 0000000..067c9ec Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed0.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed1.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed1.png new file mode 100644 index 0000000..3f44e7b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed1.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed2.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed2.png new file mode 100644 index 0000000..bcce844 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed2.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed3.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed3.png new file mode 100644 index 0000000..55a868d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed3.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed4.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed4.png new file mode 100644 index 0000000..7ab7188 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed4.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed5.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed5.png new file mode 100644 index 0000000..e2e720b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_net_speed5.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_question_link.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_question_link.png new file mode 100644 index 0000000..6ea2ae8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_question_link.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_ic_slider.png b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_slider.png new file mode 100644 index 0000000..72b7b12 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_ic_slider.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_animation.xml b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_animation.xml new file mode 100644 index 0000000..59d81ff --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_animation.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image0.png b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image0.png new file mode 100644 index 0000000..752ad96 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image0.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image1.png b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image1.png new file mode 100644 index 0000000..4a486a5 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image1.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image2.png b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image2.png new file mode 100644 index 0000000..18e2e46 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image2.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image3.png b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image3.png new file mode 100644 index 0000000..c8fd81f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image3.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image4.png b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image4.png new file mode 100644 index 0000000..06327aa Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image4.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image5.png b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image5.png new file mode 100644 index 0000000..bedd3f9 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image5.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image6.png b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image6.png new file mode 100644 index 0000000..24ed320 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image6.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image7.png b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image7.png new file mode 100644 index 0000000..8171db0 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_loading_image7.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_btn_show.png b/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_btn_show.png new file mode 100644 index 0000000..e502e1f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_btn_show.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_step_fail.png b/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_step_fail.png new file mode 100644 index 0000000..e822219 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_step_fail.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_step_success.png b/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_step_success.png new file mode 100644 index 0000000..7abdd3e Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_log_info_step_success.png differ diff --git a/app/src/main/res/drawable-xxhdpi/liveplayer_question_link.png b/app/src/main/res/drawable-xxhdpi/liveplayer_question_link.png new file mode 100644 index 0000000..a2c496b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/liveplayer_question_link.png differ diff --git a/app/src/main/res/drawable-xxhdpi/livepusher_btn_bg.xml b/app/src/main/res/drawable-xxhdpi/livepusher_btn_bg.xml new file mode 100644 index 0000000..b729361 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/livepusher_btn_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/livepusher_content_bg.xml b/app/src/main/res/drawable-xxhdpi/livepusher_content_bg.xml new file mode 100644 index 0000000..81646c5 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/livepusher_content_bg.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/livepusher_ic_back.png b/app/src/main/res/drawable-xxhdpi/livepusher_ic_back.png new file mode 100644 index 0000000..3d05499 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/livepusher_ic_back.png differ diff --git a/app/src/main/res/drawable-xxhdpi/livepusher_input_bg.xml b/app/src/main/res/drawable-xxhdpi/livepusher_input_bg.xml new file mode 100644 index 0000000..dc46f60 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/livepusher_input_bg.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/livepusher_question_link.png b/app/src/main/res/drawable-xxhdpi/livepusher_question_link.png new file mode 100644 index 0000000..a2c496b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/livepusher_question_link.png differ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 43665bf..2fef218 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,11 +1,20 @@ - + + + - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/liveplayer_top_bar_layout.xml b/app/src/main/res/layout/liveplayer_top_bar_layout.xml new file mode 100644 index 0000000..5ca0563 --- /dev/null +++ b/app/src/main/res/layout/liveplayer_top_bar_layout.xml @@ -0,0 +1,40 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/livepusher_activity_live_pusher_entrance.xml b/app/src/main/res/layout/livepusher_activity_live_pusher_entrance.xml new file mode 100644 index 0000000..4c26a55 --- /dev/null +++ b/app/src/main/res/layout/livepusher_activity_live_pusher_entrance.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + +