Commit 92982f93a9569e526a6d0c4146113290b02d32e5
0 parents
添加娱票儿demo
Showing
100 changed files
with
1899 additions
and
0 deletions
Too many changes to show.
To preserve performance only 100 of 149 files are displayed.
.gitignore
0 → 100644
.idea/compiler.xml
0 → 100644
| 1 | +++ a/.idea/compiler.xml | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="CompilerConfiguration"> | ||
| 4 | + <resourceExtensions /> | ||
| 5 | + <wildcardResourcePatterns> | ||
| 6 | + <entry name="!?*.java" /> | ||
| 7 | + <entry name="!?*.form" /> | ||
| 8 | + <entry name="!?*.class" /> | ||
| 9 | + <entry name="!?*.groovy" /> | ||
| 10 | + <entry name="!?*.scala" /> | ||
| 11 | + <entry name="!?*.flex" /> | ||
| 12 | + <entry name="!?*.kt" /> | ||
| 13 | + <entry name="!?*.clj" /> | ||
| 14 | + <entry name="!?*.aj" /> | ||
| 15 | + </wildcardResourcePatterns> | ||
| 16 | + <annotationProcessing> | ||
| 17 | + <profile default="true" name="Default" enabled="false"> | ||
| 18 | + <processorPath useClasspath="true" /> | ||
| 19 | + </profile> | ||
| 20 | + </annotationProcessing> | ||
| 21 | + </component> | ||
| 22 | +</project> | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
.idea/copyright/profiles_settings.xml
0 → 100644
.idea/gradle.xml
0 → 100644
| 1 | +++ a/.idea/gradle.xml | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="GradleSettings"> | ||
| 4 | + <option name="linkedExternalProjectsSettings"> | ||
| 5 | + <GradleProjectSettings> | ||
| 6 | + <option name="distributionType" value="DEFAULT_WRAPPED" /> | ||
| 7 | + <option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
| 8 | + <option name="modules"> | ||
| 9 | + <set> | ||
| 10 | + <option value="$PROJECT_DIR$" /> | ||
| 11 | + <option value="$PROJECT_DIR$/app" /> | ||
| 12 | + </set> | ||
| 13 | + </option> | ||
| 14 | + <option name="resolveModulePerSourceSet" value="false" /> | ||
| 15 | + </GradleProjectSettings> | ||
| 16 | + </option> | ||
| 17 | + </component> | ||
| 18 | +</project> | ||
| 0 | \ No newline at end of file | 19 | \ No newline at end of file |
.idea/misc.xml
0 → 100644
| 1 | +++ a/.idea/misc.xml | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="ProjectLevelVcsManager" settingsEditedManually="false"> | ||
| 4 | + <OptionsSetting value="true" id="Add" /> | ||
| 5 | + <OptionsSetting value="true" id="Remove" /> | ||
| 6 | + <OptionsSetting value="true" id="Checkout" /> | ||
| 7 | + <OptionsSetting value="true" id="Update" /> | ||
| 8 | + <OptionsSetting value="true" id="Status" /> | ||
| 9 | + <OptionsSetting value="true" id="Edit" /> | ||
| 10 | + <ConfirmationsSetting value="0" id="Add" /> | ||
| 11 | + <ConfirmationsSetting value="0" id="Remove" /> | ||
| 12 | + </component> | ||
| 13 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | ||
| 14 | + <output url="file://$PROJECT_DIR$/build/classes" /> | ||
| 15 | + </component> | ||
| 16 | + <component name="ProjectType"> | ||
| 17 | + <option name="id" value="Android" /> | ||
| 18 | + </component> | ||
| 19 | + <component name="masterDetails"> | ||
| 20 | + <states> | ||
| 21 | + <state key="ProjectJDKs.UI"> | ||
| 22 | + <settings> | ||
| 23 | + <last-edited>1.8</last-edited> | ||
| 24 | + <splitter-proportions> | ||
| 25 | + <option name="proportions"> | ||
| 26 | + <list> | ||
| 27 | + <option value="0.2" /> | ||
| 28 | + </list> | ||
| 29 | + </option> | ||
| 30 | + </splitter-proportions> | ||
| 31 | + </settings> | ||
| 32 | + </state> | ||
| 33 | + </states> | ||
| 34 | + </component> | ||
| 35 | +</project> | ||
| 0 | \ No newline at end of file | 36 | \ No newline at end of file |
.idea/modules.xml
0 → 100644
| 1 | +++ a/.idea/modules.xml | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="ProjectModuleManager"> | ||
| 4 | + <modules> | ||
| 5 | + <module fileurl="file://$PROJECT_DIR$/CNPlayerDemo.iml" filepath="$PROJECT_DIR$/CNPlayerDemo.iml" /> | ||
| 6 | + <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> | ||
| 7 | + </modules> | ||
| 8 | + </component> | ||
| 9 | +</project> | ||
| 0 | \ No newline at end of file | 10 | \ No newline at end of file |
.idea/runConfigurations.xml
0 → 100644
| 1 | +++ a/.idea/runConfigurations.xml | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="RunConfigurationProducerService"> | ||
| 4 | + <option name="ignoredProducers"> | ||
| 5 | + <set> | ||
| 6 | + <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" /> | ||
| 7 | + <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" /> | ||
| 8 | + <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" /> | ||
| 9 | + </set> | ||
| 10 | + </option> | ||
| 11 | + </component> | ||
| 12 | +</project> | ||
| 0 | \ No newline at end of file | 13 | \ No newline at end of file |
app/.gitignore
0 → 100644
app/build.gradle
0 → 100644
| 1 | +++ a/app/build.gradle | ||
| 1 | +apply plugin: 'com.android.application' | ||
| 2 | + | ||
| 3 | +android { | ||
| 4 | + compileSdkVersion 23 | ||
| 5 | + buildToolsVersion '23.0.3' | ||
| 6 | + defaultConfig { | ||
| 7 | + applicationId "com.wepiao.star.starlive" | ||
| 8 | + minSdkVersion 16 | ||
| 9 | + targetSdkVersion 22 | ||
| 10 | + versionCode 1 | ||
| 11 | + versionName "1.0" | ||
| 12 | + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
| 13 | + } | ||
| 14 | + buildTypes { | ||
| 15 | + release { | ||
| 16 | + minifyEnabled false | ||
| 17 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
| 18 | + } | ||
| 19 | + } | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +dependencies { | ||
| 23 | + compile fileTree(include: ['*.jar'], dir: 'libs') | ||
| 24 | + compile 'com.android.support:appcompat-v7:23.4.0' | ||
| 25 | + compile 'com.android.support:recyclerview-v7:23.4.0' | ||
| 26 | + compile 'org.igniterealtime.smack:smack-android-extensions:4.1.4' | ||
| 27 | + compile 'org.igniterealtime.smack:smack-tcp:4.1.4' | ||
| 28 | + compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3' | ||
| 29 | + compile files('libs/cnvideo_2.0.jar') | ||
| 30 | +} |
app/libs/cnvideo_2.0.jar
0 → 100644
No preview for this file type
app/proguard-rules.pro
0 → 100644
| 1 | +++ a/app/proguard-rules.pro | ||
| 1 | +# Add project specific ProGuard rules here. | ||
| 2 | +# By default, the flags in this file are appended to flags specified | ||
| 3 | +# in C:\Users\bjwan\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt | ||
| 4 | +# You can edit the include path and order by changing the proguardFiles | ||
| 5 | +# directive in build.gradle. | ||
| 6 | +# | ||
| 7 | +# For more details, see | ||
| 8 | +# http://developer.android.com/guide/developing/tools/proguard.html | ||
| 9 | + | ||
| 10 | +# Add any project specific keep options here: | ||
| 11 | + | ||
| 12 | +# If your project uses WebView with JS, uncomment the following | ||
| 13 | +# and specify the fully qualified class name to the JavaScript interface | ||
| 14 | +# class: | ||
| 15 | +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| 16 | +# public *; | ||
| 17 | +#} |
app/src/main/AndroidManifest.xml
0 → 100644
| 1 | +++ a/app/src/main/AndroidManifest.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + package="com.wepiao.star.starlive"> | ||
| 4 | + | ||
| 5 | + <uses-permission android:name="android.permission.INTERNET" /> | ||
| 6 | + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
| 7 | + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | ||
| 8 | + <uses-permission android:name="android.permission.READ_PHONE_STATE"/> | ||
| 9 | + | ||
| 10 | + <uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
| 11 | + <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> | ||
| 12 | + <uses-permission android:name="android.permission.INTERNET" /> | ||
| 13 | + <uses-permission android:name="android.permission.READ_PHONE_SINTERNETWIFI_STATE" /> | ||
| 14 | + <uses-permission android:name="android.permission.CAMERA" /> | ||
| 15 | + <uses-permission android:name="android.permission.RECORD_AUDIO" /> | ||
| 16 | + <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> | ||
| 17 | + <uses-permission android:name="android.permission.FLASHLIGHT" /> | ||
| 18 | + <uses-permission android:name="android.permission.VIBRATE" /> | ||
| 19 | + <!-- 硬件特性 --> | ||
| 20 | + <uses-feature android:name="android.hardware.camera" /> | ||
| 21 | + <uses-feature android:name="android.hardware.camera.autofocus" /> | ||
| 22 | + <uses-feature android:name="android.hardware.camera.flash" /> | ||
| 23 | + <!----> | ||
| 24 | + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | ||
| 25 | + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
| 26 | + | ||
| 27 | + <application | ||
| 28 | + android:name="com.wepiao.star.starlive.TestApplication" | ||
| 29 | + android:allowBackup="true" | ||
| 30 | + android:icon="@mipmap/ic_launcher" | ||
| 31 | + android:label="@string/app_name" | ||
| 32 | + android:supportsRtl="true" | ||
| 33 | + android:theme="@style/AppTheme"> | ||
| 34 | + <activity android:name="com.wepiao.star.starlive.MainActivity"> | ||
| 35 | + <intent-filter> | ||
| 36 | + <action android:name="android.intent.action.MAIN" /> | ||
| 37 | + | ||
| 38 | + <category android:name="android.intent.category.LAUNCHER" /> | ||
| 39 | + </intent-filter> | ||
| 40 | + </activity> | ||
| 41 | + | ||
| 42 | + <activity | ||
| 43 | + android:name="com.wepiao.star.starlive.ui.PlayerActivity" | ||
| 44 | + android:configChanges="keyboardHidden|screenSize|orientation" | ||
| 45 | + android:launchMode="singleTask" | ||
| 46 | + android:screenOrientation="portrait" | ||
| 47 | + android:theme="@style/Theme.AppCompat.Light.NoActionBar" | ||
| 48 | + android:windowSoftInputMode="adjustResize"/> | ||
| 49 | + | ||
| 50 | + <activity | ||
| 51 | + android:name="com.wepiao.star.starlive.ui.PlayerUgcActivity" | ||
| 52 | + android:configChanges="keyboardHidden|screenSize|orientation" | ||
| 53 | + android:launchMode="singleTask" | ||
| 54 | + android:screenOrientation="portrait" | ||
| 55 | + android:theme="@style/Theme.AppCompat.Light.NoActionBar" | ||
| 56 | + android:windowSoftInputMode="adjustResize" /> | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + <activity | ||
| 60 | + android:name="com.wepiao.star.starlive.ui.StreamActivity" | ||
| 61 | + android:configChanges="orientation|keyboardHidden|screenSize" | ||
| 62 | + android:launchMode="singleTop" | ||
| 63 | + android:screenOrientation="portrait" /> | ||
| 64 | + </application> | ||
| 65 | + | ||
| 66 | +</manifest> | ||
| 0 | \ No newline at end of file | 67 | \ No newline at end of file |
app/src/main/java/com/wepiao/star/starlive/MainActivity.java
0 → 100644
| 1 | +++ a/app/src/main/java/com/wepiao/star/starlive/MainActivity.java | ||
| 1 | +package com.wepiao.star.starlive; | ||
| 2 | + | ||
| 3 | +import android.content.Intent; | ||
| 4 | +import android.os.Bundle; | ||
| 5 | +import android.support.v7.app.AppCompatActivity; | ||
| 6 | +import android.view.View; | ||
| 7 | + | ||
| 8 | +import com.wepiao.star.starlive.ui.PlayerActivity; | ||
| 9 | +import com.wepiao.star.starlive.ui.PlayerUgcActivity; | ||
| 10 | +import com.wepiao.star.starlive.ui.StreamActivity; | ||
| 11 | + | ||
| 12 | +public class MainActivity extends AppCompatActivity implements View.OnClickListener { | ||
| 13 | + | ||
| 14 | + @Override | ||
| 15 | + protected void onCreate(Bundle savedInstanceState) { | ||
| 16 | + super.onCreate(savedInstanceState); | ||
| 17 | + setContentView(R.layout.activity_main); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + @Override | ||
| 21 | + public void onClick(View v) { | ||
| 22 | + Intent intent ; | ||
| 23 | + switch (v.getId()){ | ||
| 24 | + case R.id.click_player_live: | ||
| 25 | + intent = new Intent(MainActivity.this, PlayerActivity.class); | ||
| 26 | + startActivity(intent); | ||
| 27 | + break; | ||
| 28 | + case R.id.click_player_ugc_live: | ||
| 29 | + intent = new Intent(MainActivity.this, PlayerUgcActivity.class); | ||
| 30 | + intent.putExtra("channelId", "yupiao"); | ||
| 31 | + intent.putExtra("type", "ugcLive"); | ||
| 32 | + intent.putExtra("flyKissPrice", "10"); | ||
| 33 | + intent.putExtra("hasMovie", true); | ||
| 34 | + startActivity(intent); | ||
| 35 | + break; | ||
| 36 | + case R.id.click_player_ugc_vod: | ||
| 37 | + intent = new Intent(MainActivity.this, PlayerUgcActivity.class); | ||
| 38 | + intent.putExtra("vId","20161126"); | ||
| 39 | + intent.putExtra("type","ugcVod"); | ||
| 40 | + intent.putExtra("hasMovie", true); | ||
| 41 | + startActivity(intent); | ||
| 42 | + break; | ||
| 43 | + case R.id.click_player_ugc_stream: | ||
| 44 | + intent = new Intent(MainActivity.this, StreamActivity.class); | ||
| 45 | + startActivity(intent); | ||
| 46 | + break; | ||
| 47 | + } | ||
| 48 | + } | ||
| 49 | +} |
app/src/main/java/com/wepiao/star/starlive/TestApplication.java
0 → 100644
| 1 | +++ a/app/src/main/java/com/wepiao/star/starlive/TestApplication.java | ||
| 1 | +package com.wepiao.star.starlive; | ||
| 2 | + | ||
| 3 | +import android.app.Application; | ||
| 4 | + | ||
| 5 | +import com.cnlive.libs.util.Config; | ||
| 6 | +import com.nostra13.universalimageloader.core.ImageLoader; | ||
| 7 | +import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * Created by xiansong on 2016/7/8. | ||
| 11 | + */ | ||
| 12 | +public class TestApplication extends Application { | ||
| 13 | + @Override | ||
| 14 | + public void onCreate() { | ||
| 15 | + super.onCreate(); | ||
| 16 | + | ||
| 17 | + Config.init(this,"27_itclq5g039","2f5f46cffedbfc37105b3ad66d9cf473557920bdc8837c"); | ||
| 18 | + | ||
| 19 | + ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this).build(); | ||
| 20 | + ImageLoader.getInstance().init(configuration); | ||
| 21 | + } | ||
| 22 | +} |
app/src/main/java/com/wepiao/star/starlive/model/BaseContributionInfo.java
0 → 100644
| 1 | +++ a/app/src/main/java/com/wepiao/star/starlive/model/BaseContributionInfo.java | ||
| 1 | +package com.wepiao.star.starlive.model; | ||
| 2 | + | ||
| 3 | +import com.cnlive.lib_cnvideo.model.ContributionInfo; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * Created by xiansong on 2016/9/5. | ||
| 7 | + */ | ||
| 8 | +public class BaseContributionInfo implements ContributionInfo { | ||
| 9 | + | ||
| 10 | + private String avatar; | ||
| 11 | + private String count; | ||
| 12 | + | ||
| 13 | + public BaseContributionInfo(String avatar, String count) { | ||
| 14 | + this.avatar = avatar; | ||
| 15 | + this.count = count; | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + @Override | ||
| 19 | + public String getAvatar() { | ||
| 20 | + return avatar; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public void setAvatar(String avatar) { | ||
| 24 | + this.avatar = avatar; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + @Override | ||
| 28 | + public String getCount() { | ||
| 29 | + return count; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public void setCount(String count) { | ||
| 33 | + this.count = count; | ||
| 34 | + } | ||
| 35 | +} |
app/src/main/java/com/wepiao/star/starlive/ui/PlayerActivity.java
0 → 100644
| 1 | +++ a/app/src/main/java/com/wepiao/star/starlive/ui/PlayerActivity.java | ||
| 1 | +package com.wepiao.star.starlive.ui; | ||
| 2 | + | ||
| 3 | +import android.graphics.Color; | ||
| 4 | +import android.os.Bundle; | ||
| 5 | +import android.support.annotation.Nullable; | ||
| 6 | +import android.text.Spannable; | ||
| 7 | +import android.text.SpannableString; | ||
| 8 | +import android.text.style.ForegroundColorSpan; | ||
| 9 | +import android.text.style.UnderlineSpan; | ||
| 10 | +import android.view.View; | ||
| 11 | +import android.widget.Toast; | ||
| 12 | + | ||
| 13 | +import com.cnlive.lib_cnvideo.ui.CnlivePlayerActivity; | ||
| 14 | +import com.cnlive.libs.chat.ChatState; | ||
| 15 | +import com.ksyun.media.player.IMediaPlayer; | ||
| 16 | +import com.wepiao.star.starlive.R; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * Created by gujun on 2016/7/7. | ||
| 20 | + */ | ||
| 21 | +public class PlayerActivity extends CnlivePlayerActivity { | ||
| 22 | + | ||
| 23 | + private static final String room = "cnlivetest"; | ||
| 24 | + private static final String name = "游客"; | ||
| 25 | + | ||
| 26 | + @Override | ||
| 27 | + protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
| 28 | + super.onCreate(savedInstanceState); | ||
| 29 | + setContentView(R.layout.cnlive_activity_player); | ||
| 30 | + //初始化播放器 channelID | ||
| 31 | + setVideoMessage("xinyingshi"); | ||
| 32 | + //初始化弹幕视图 间隔时间,行数,行弹幕最大值,速度(0.1-1.0) | ||
| 33 | + initBarrage(400, 5, 10, 0.5f); | ||
| 34 | + //初始化聊天室 房间号,用户昵称 | ||
| 35 | + initChat(room, name); | ||
| 36 | + | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + @Override | ||
| 40 | + protected void shareViewClick() { | ||
| 41 | + Toast.makeText(this, "分享", Toast.LENGTH_SHORT).show(); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * @param iMediaPlayer | ||
| 46 | + * @param what | ||
| 47 | + * @param extra 对应错误信息详见说明文档 | ||
| 48 | + * 播放异常重试功能调用retryToPlay(); | ||
| 49 | + */ | ||
| 50 | + @Override | ||
| 51 | + protected void onPlayStateError(int flag, IMediaPlayer iMediaPlayer, int what, String extra) { | ||
| 52 | + super.onPlayStateError(flag, iMediaPlayer, what, extra); | ||
| 53 | + //使用方法: | ||
| 54 | + // 1.如果使用sdk自带的加载失败界面的话请加上super.onPlayStateError(iMediaPlayer,what,extra); | ||
| 55 | + // 2.如果不适用sdk自带的加载失败界面的话请删除super.onPlayStateError(iMediaPlayer,what,extra), | ||
| 56 | + // 在app端新建的加载失败页面的重试按钮添加点击事件调用retryToPlay();添加重试功能 | ||
| 57 | + Toast.makeText(this, "播放异常", Toast.LENGTH_SHORT).show(); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Override | ||
| 61 | + protected void showInputLimitDialog() { | ||
| 62 | + //TODO 展示限制60输入的dialog 注意:添加dialog要进行if(!dialog.isShowing())的判断,否则会有弹出多次问题 | ||
| 63 | + Toast.makeText(this, "展示输入超过60字的提示框", Toast.LENGTH_SHORT).show(); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + @Override | ||
| 67 | + protected void showInputSensitiveWordsDialog(String msg) { | ||
| 68 | + //TODO 展示敏感词的dialog | ||
| 69 | + Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + //聊天室事件监听 | ||
| 73 | + @Override | ||
| 74 | + public void onChatState(int what, String extra) { | ||
| 75 | + switch (what) { | ||
| 76 | + case ChatState.StateInitDone: //初始化完成 | ||
| 77 | + connectChat();//连接聊天室 | ||
| 78 | + break; | ||
| 79 | + case ChatState.ErrorInitAuth: //认证失败 | ||
| 80 | + case ChatState.ErrorInitNetwork: //未检测到网络 | ||
| 81 | + case ChatState.ErrorInitOther: //初始化错误 | ||
| 82 | + showMessage("聊天室初始化失败,点击重试", clickErrorInit);//设置错误信息 | ||
| 83 | + break; | ||
| 84 | + case ChatState.StateConnect: //与服务器建立连接 | ||
| 85 | + break; | ||
| 86 | + case ChatState.StateJoin: //聊天室登录成功 | ||
| 87 | + hideMessage();//隐藏错误信息 | ||
| 88 | + break; | ||
| 89 | + case ChatState.StateReconnect: //与服务器重新连接 | ||
| 90 | + connectChat(); | ||
| 91 | + break; | ||
| 92 | + case ChatState.ErrorConnect: //连接服务器失败 | ||
| 93 | + case ChatState.ErrorChat: //聊天室连接失败 | ||
| 94 | + case ChatState.ErrorName: //昵称冲突 | ||
| 95 | + String message = "聊天室连接失败,点击重试"; | ||
| 96 | + SpannableString spannableString = new SpannableString(message); //定义文字样式 | ||
| 97 | + spannableString.setSpan(new UnderlineSpan(), message.length() - 2, message.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); | ||
| 98 | + spannableString.setSpan(new ForegroundColorSpan(Color.rgb(255, 213, 0)), message.length() - 2, message.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); | ||
| 99 | + showMessage(spannableString, clickErrorConnect);//设置错误信息 | ||
| 100 | + break; | ||
| 101 | + case ChatState.ErrorConnectCloseOnError: //聊天室异常断开 | ||
| 102 | + showMessage("聊天室已断开,请检查网络"); | ||
| 103 | + break; | ||
| 104 | + case ChatState.ErrorSendOther: //消息发送失败 | ||
| 105 | + Toast.makeText(this,extra, Toast.LENGTH_SHORT).show(); | ||
| 106 | + break; | ||
| 107 | + case ChatState.ErrorSendNoConnect: //消息发送失败 没有连接聊天室 | ||
| 108 | + Toast.makeText(this,extra, Toast.LENGTH_SHORT).show(); | ||
| 109 | + break; | ||
| 110 | + } | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + //聊天室连接失败 点击事件 | ||
| 114 | + protected View.OnClickListener clickErrorConnect = new View.OnClickListener() { | ||
| 115 | + @Override | ||
| 116 | + public void onClick(View v) { | ||
| 117 | + v.setOnClickListener(null); | ||
| 118 | + connectChat(); | ||
| 119 | + } | ||
| 120 | + }; | ||
| 121 | + | ||
| 122 | + //聊天室初始化失败 点击事件 | ||
| 123 | + protected View.OnClickListener clickErrorInit = new View.OnClickListener() { | ||
| 124 | + @Override | ||
| 125 | + public void onClick(View v) { | ||
| 126 | + v.setOnClickListener(null); | ||
| 127 | + initChat(room, name); | ||
| 128 | + } | ||
| 129 | + }; | ||
| 130 | +} |
app/src/main/java/com/wepiao/star/starlive/ui/PlayerUgcActivity.java
0 → 100644
| 1 | +++ a/app/src/main/java/com/wepiao/star/starlive/ui/PlayerUgcActivity.java | ||
| 1 | +package com.wepiao.star.starlive.ui; | ||
| 2 | + | ||
| 3 | +import android.content.Intent; | ||
| 4 | +import android.graphics.Color; | ||
| 5 | +import android.os.Bundle; | ||
| 6 | +import android.support.annotation.Nullable; | ||
| 7 | +import android.text.Spannable; | ||
| 8 | +import android.text.SpannableString; | ||
| 9 | +import android.text.style.ForegroundColorSpan; | ||
| 10 | +import android.text.style.UnderlineSpan; | ||
| 11 | +import android.view.View; | ||
| 12 | +import android.widget.Toast; | ||
| 13 | + | ||
| 14 | +import com.wepiao.star.starlive.R; | ||
| 15 | +import com.wepiao.star.starlive.model.BaseContributionInfo; | ||
| 16 | +import com.cnlive.lib_cnvideo.model.ContributionInfo; | ||
| 17 | +import com.cnlive.lib_cnvideo.ui.CnliveUgcPlayerActivity; | ||
| 18 | +import com.cnlive.lib_cnvideo.ui.widget.player.CNMediaPlayerType; | ||
| 19 | +import com.cnlive.libs.chat.ChatState; | ||
| 20 | +import com.ksyun.media.player.IMediaPlayer; | ||
| 21 | + | ||
| 22 | +import java.util.ArrayList; | ||
| 23 | +import java.util.List; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Created by gujun on 2016/7/12. | ||
| 27 | + */ | ||
| 28 | +public class PlayerUgcActivity extends CnliveUgcPlayerActivity { | ||
| 29 | + private String vId; | ||
| 30 | + private String channelId; | ||
| 31 | + private String type; | ||
| 32 | + private boolean hasMovie; | ||
| 33 | + private String flyKissPrice; | ||
| 34 | + | ||
| 35 | + private static final String room = "cnlivetest"; | ||
| 36 | + private static final String name = "游客"+ System.currentTimeMillis(); | ||
| 37 | + | ||
| 38 | + //TODO 问题消息体 {"type":"question","user_name":"name","mbody":"test message","imgurl":"http://y3.cnliveimg.com:8080/image/itv/2016/0729/c48d1db2dc1641f19d90ef23e294d34a_139042_100.jpg","num":"5"} | ||
| 39 | + | ||
| 40 | + @Override | ||
| 41 | + protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
| 42 | + super.onCreate(savedInstanceState); | ||
| 43 | + setContentView(R.layout.cnlive_activity_ugc_player); | ||
| 44 | + | ||
| 45 | + addData(getIntent()); | ||
| 46 | + | ||
| 47 | + //更新排行榜列表 | ||
| 48 | + findViewById(R.id.test1).setOnClickListener(new View.OnClickListener() { | ||
| 49 | + @Override | ||
| 50 | + public void onClick(View v) { | ||
| 51 | + List<ContributionInfo> list = new ArrayList<>(); | ||
| 52 | + list.add(new BaseContributionInfo("http://v1.qzone.cc/avatar/201403/23/11/54/532e5aefc546e496.jpg!200x200.jpg","1")); | ||
| 53 | + list.add(new BaseContributionInfo("http://imgsrc.baidu.com/baike/pic/item/c2fdfc039245d6882d5d54d9a6c27d1ed21b2474.jpg","2")); | ||
| 54 | + list.add(new BaseContributionInfo("http://img2.a0bi.com/upload/ttq/20160709/1468043314019.png","1")); | ||
| 55 | + list.add(new BaseContributionInfo("http://b.hiphotos.baidu.com/zhidao/pic/item/d1a20cf431adcbefef0f982fabaf2edda3cc9fe4.jpg","2")); | ||
| 56 | + list.add(new BaseContributionInfo("http://img2.a0bi.com/upload/ttq/20160817/1471399679901.png","1")); | ||
| 57 | + list.add(new BaseContributionInfo("http://img2.a0bi.com/upload/ttq/20160709/1468043314019.png","2")); | ||
| 58 | + updateContributionList(list); | ||
| 59 | + } | ||
| 60 | + }); | ||
| 61 | + | ||
| 62 | + //更新收入 | ||
| 63 | + findViewById(R.id.test2).setOnClickListener(new View.OnClickListener() { | ||
| 64 | + @Override | ||
| 65 | + public void onClick(View v) { | ||
| 66 | + updateIncome(2334455); | ||
| 67 | + } | ||
| 68 | + }); | ||
| 69 | + | ||
| 70 | + //更新累计关注人数 | ||
| 71 | + findViewById(R.id.test3).setOnClickListener(new View.OnClickListener() { | ||
| 72 | + @Override | ||
| 73 | + public void onClick(View v) { | ||
| 74 | + updateFollowCount(1122333); | ||
| 75 | + } | ||
| 76 | + }); | ||
| 77 | + | ||
| 78 | + if("ugcLive".equals(type)){ | ||
| 79 | + //初始化弹幕视图 间隔时间,行数,行弹幕最大值,速度(0.1-1.0) | ||
| 80 | + initTopBarrage(400, 2, 10, 0.5f); | ||
| 81 | + initBottomBarrage(400, 5, 10, 0.5f); | ||
| 82 | + //初始化聊天室 房间号,用户昵称 | ||
| 83 | + initChat(room, name); | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + //内部view创建完成可以进行相关的更新ui操作 | ||
| 89 | + @Override | ||
| 90 | + public void viewCreated() { | ||
| 91 | + //TODO 添加相关的更新ui操作 | ||
| 92 | + updateIncome(2334455); | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + @Override | ||
| 96 | + protected void onNewIntent(Intent intent) { | ||
| 97 | + super.onNewIntent(intent); | ||
| 98 | + addData(intent); | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + private void addData(Intent intent) { | ||
| 102 | + if(intent == null) return; | ||
| 103 | + if (intent.hasExtra("vId")) | ||
| 104 | + vId = intent.getStringExtra("vId"); | ||
| 105 | + if (intent.hasExtra("channelId")) | ||
| 106 | + channelId = intent.getStringExtra("channelId"); | ||
| 107 | + if (intent.hasExtra("type")) | ||
| 108 | + type = intent.getStringExtra("type"); | ||
| 109 | + if (intent.hasExtra("flyKissPrice")) | ||
| 110 | + flyKissPrice = intent.getStringExtra("flyKissPrice"); | ||
| 111 | + if (intent.hasExtra("hasMovie")) | ||
| 112 | + hasMovie = intent.getBooleanExtra("hasMovie",false); | ||
| 113 | + if(type.equals("ugcLive")){ | ||
| 114 | + // channelId直播节目频道id; hasMovie:有无电影; flyKissPrice:购买飞吻钱数(无电影时必须传值,有电影时传空即可) | ||
| 115 | + setLiveVideoData(channelId, hasMovie, flyKissPrice); | ||
| 116 | + }else if(type.equals("ugcVod")){ | ||
| 117 | + //vId点播节目id ;hasMovie:有无电影 | ||
| 118 | + setVodVideoData(vId,hasMovie); | ||
| 119 | + }else{ | ||
| 120 | + Toast.makeText(this,"暂不支持此种视频类型", Toast.LENGTH_LONG).show(); | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + @Override | ||
| 125 | + protected void shareViewClick() { | ||
| 126 | + Toast.makeText(this, "分享点击", Toast.LENGTH_SHORT).show(); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + @Override | ||
| 130 | + protected void anchorInfoClick() { | ||
| 131 | + Toast.makeText(this, "主播信息点击", Toast.LENGTH_SHORT).show(); | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + @Override | ||
| 135 | + protected void contributionListClick() { | ||
| 136 | + Toast.makeText(this, "贡献榜点击", Toast.LENGTH_SHORT).show(); | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + @Override | ||
| 140 | + protected void supportAnchorClick() { | ||
| 141 | + Toast.makeText(this, "支持TA点击", Toast.LENGTH_SHORT).show(); | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + @Override | ||
| 145 | + protected void sendGiftClick() { | ||
| 146 | + Toast.makeText(this, "送飞吻点击", Toast.LENGTH_SHORT).show(); | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + @Override | ||
| 150 | + public void movieInfoClick() { | ||
| 151 | + Toast.makeText(this, "有电影版的直播结束页面的电影详情点击", Toast.LENGTH_SHORT).show(); | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + @Override | ||
| 155 | + protected void showInputLimitDialog() { | ||
| 156 | + //TODO 展示限制60输入的dialog 注意:添加dialog要进行if(!dialog.isShowing())的判断,否则会有弹出多次问题 | ||
| 157 | + Toast.makeText(this, "展示输入超过60字的提示框", Toast.LENGTH_SHORT).show(); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + @Override | ||
| 161 | + protected void showInputSensitiveWordsDialog(String msg) { | ||
| 162 | + //TODO 展示敏感词的dialog | ||
| 163 | + Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + @Override | ||
| 167 | + protected void replayClick() { | ||
| 168 | + Toast.makeText(this, "直播结束页面的重播按钮点击", Toast.LENGTH_SHORT).show(); | ||
| 169 | + | ||
| 170 | + //TODO 添加正式的vId,type,hasMovie | ||
| 171 | + Intent intent = new Intent(this, PlayerUgcActivity.class); | ||
| 172 | + intent.putExtra("cId", "yupiao"); | ||
| 173 | + intent.putExtra("type", "ugcLive"); | ||
| 174 | + intent.putExtra("hasMovie", false); | ||
| 175 | + startActivity(intent); | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + @Override | ||
| 179 | + public void onPlayStateError(int flag, IMediaPlayer iMediaPlayer, int what, String extra) { | ||
| 180 | + //ugc直播时才会有结束页 | ||
| 181 | + boolean isUgcLive = "ugcLive".equals(type); | ||
| 182 | + if(flag == CNMediaPlayerType.TYPE_ERROR_PLAYER && isUgcLive){ | ||
| 183 | + //TODO 请求判断是否是结束状态 将值赋予showLiveEndView | ||
| 184 | + | ||
| 185 | + //test | ||
| 186 | + boolean showLiveEndView = true; | ||
| 187 | + | ||
| 188 | + if (showLiveEndView) { | ||
| 189 | + // 展示 直播结束页面 | ||
| 190 | + // 第一个参:数观看的人数,第二个参数:贡献的钱数,第三个参数:电影名 | ||
| 191 | + showLiveEndView("12345", "345456", "《让子弹飞》"); | ||
| 192 | + } else { | ||
| 193 | + // 展示 直播重试页面 | ||
| 194 | + showErrorRetryView(flag); | ||
| 195 | + } | ||
| 196 | + }else{ | ||
| 197 | + showErrorRetryView(flag); | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + //判断主播端状态 | ||
| 202 | + @Override | ||
| 203 | + public void onChannelState(int flag, String status) { | ||
| 204 | + super.onChannelState(flag, status); | ||
| 205 | + if (CNMediaPlayerType.ERROR_END.equals(status)) { | ||
| 206 | + showErrorRetryView(flag); | ||
| 207 | + stopMediaPlayer(); | ||
| 208 | + } else if (CNMediaPlayerType.NORMAL_END.equals(status)) { | ||
| 209 | + showLiveEndView("12345", "345456", "《让子弹飞》"); | ||
| 210 | + stopMediaPlayer(); | ||
| 211 | + } else if (CNMediaPlayerType.NORMAL_START.equals(status)) { | ||
| 212 | + replayClick(); | ||
| 213 | + } | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + //聊天室事件监听 | ||
| 217 | + @Override | ||
| 218 | + public void onChatState(int what, String extra) { | ||
| 219 | + switch (what) { | ||
| 220 | + case ChatState.StateInitDone: //初始化完成 | ||
| 221 | + connectChat();//连接聊天室 | ||
| 222 | + break; | ||
| 223 | + case ChatState.ErrorInitAuth: //认证失败 | ||
| 224 | + case ChatState.ErrorInitNetwork: //未检测到网络 | ||
| 225 | + case ChatState.ErrorInitOther: //初始化错误 | ||
| 226 | + showMessage("聊天室初始化失败,点击重试", clickErrorInit);//设置错误信息 | ||
| 227 | + break; | ||
| 228 | + case ChatState.StateConnect: //与服务器建立连接 | ||
| 229 | + break; | ||
| 230 | + case ChatState.StateJoin: //聊天室登录成功 | ||
| 231 | + hideMessage();//隐藏错误信息 | ||
| 232 | + break; | ||
| 233 | + case ChatState.StateReconnect: //与服务器重新连接 | ||
| 234 | + connectChat(); | ||
| 235 | + break; | ||
| 236 | + case ChatState.ErrorConnect: //连接服务器失败 | ||
| 237 | + case ChatState.ErrorChat: //聊天室连接失败 | ||
| 238 | + case ChatState.ErrorName: //昵称冲突 | ||
| 239 | + String message = "聊天室连接失败,点击重试"; | ||
| 240 | + SpannableString spannableString = new SpannableString(message); //定义文字样式 | ||
| 241 | + spannableString.setSpan(new UnderlineSpan(), message.length() - 2, message.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); | ||
| 242 | + spannableString.setSpan(new ForegroundColorSpan(Color.rgb(255, 213, 0)), message.length() - 2, message.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); | ||
| 243 | + showMessage(spannableString, clickErrorConnect);//设置错误信息 | ||
| 244 | + break; | ||
| 245 | + case ChatState.ErrorConnectCloseOnError: //聊天室异常断开 | ||
| 246 | + showMessage("聊天室已断开,请检查网络"); | ||
| 247 | + break; | ||
| 248 | + case ChatState.ErrorSendOther: //消息发送失败 | ||
| 249 | + Toast.makeText(this,extra, Toast.LENGTH_SHORT).show(); | ||
| 250 | + break; | ||
| 251 | + case ChatState.ErrorSendNoConnect: //消息发送失败 没有连接聊天室 | ||
| 252 | + Toast.makeText(this,extra, Toast.LENGTH_SHORT).show(); | ||
| 253 | + break; | ||
| 254 | + } | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + //聊天室连接失败 点击事件 | ||
| 258 | + protected View.OnClickListener clickErrorConnect = new View.OnClickListener() { | ||
| 259 | + @Override | ||
| 260 | + public void onClick(View v) { | ||
| 261 | + v.setOnClickListener(null); | ||
| 262 | + connectChat(); | ||
| 263 | + } | ||
| 264 | + }; | ||
| 265 | + | ||
| 266 | + //聊天室初始化失败 点击事件 | ||
| 267 | + protected View.OnClickListener clickErrorInit = new View.OnClickListener() { | ||
| 268 | + @Override | ||
| 269 | + public void onClick(View v) { | ||
| 270 | + v.setOnClickListener(null); | ||
| 271 | + initChat(room, name); | ||
| 272 | + } | ||
| 273 | + }; | ||
| 274 | +} |
app/src/main/java/com/wepiao/star/starlive/ui/StreamActivity.java
0 → 100644
| 1 | +++ a/app/src/main/java/com/wepiao/star/starlive/ui/StreamActivity.java | ||
| 1 | +package com.wepiao.star.starlive.ui; | ||
| 2 | + | ||
| 3 | +import android.graphics.Color; | ||
| 4 | +import android.os.Bundle; | ||
| 5 | +import android.text.Spannable; | ||
| 6 | +import android.text.SpannableString; | ||
| 7 | +import android.text.style.ForegroundColorSpan; | ||
| 8 | +import android.text.style.UnderlineSpan; | ||
| 9 | +import android.util.Log; | ||
| 10 | +import android.view.View; | ||
| 11 | +import android.view.WindowManager; | ||
| 12 | +import android.widget.Button; | ||
| 13 | +import android.widget.Toast; | ||
| 14 | + | ||
| 15 | +import com.wepiao.star.starlive.R; | ||
| 16 | +import com.wepiao.star.starlive.model.BaseContributionInfo; | ||
| 17 | +import com.cnlive.lib_cnvideo.model.ContributionInfo; | ||
| 18 | +import com.cnlive.lib_cnvideo.stream.BaseCNStreamActivity; | ||
| 19 | +import com.cnlive.libs.chat.ChatState; | ||
| 20 | +import com.cnlive.libs.stream.base.IStreamer; | ||
| 21 | + | ||
| 22 | +import java.util.ArrayList; | ||
| 23 | +import java.util.List; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Created by Administrator on 2016/8/16. | ||
| 27 | + */ | ||
| 28 | +public class StreamActivity extends BaseCNStreamActivity { | ||
| 29 | + private String activityid = "" + System.currentTimeMillis(); | ||
| 30 | + private String channelid = "yupiao"; | ||
| 31 | + private int isHorizon = 0; | ||
| 32 | + | ||
| 33 | + private Button button1, button2, button3; | ||
| 34 | + | ||
| 35 | + private static final String room = "cnlivetest"; | ||
| 36 | + private static final String name = "游客"; | ||
| 37 | + | ||
| 38 | + private static final boolean isMovie = true; | ||
| 39 | + | ||
| 40 | + //TODO 问题消息体 {"type":"question","user_name":"name","mbody":"test message","imgurl":"http://y3.cnliveimg.com:8080/image/itv/2016/0729/c48d1db2dc1641f19d90ef23e294d34a_139042_100.jpg","num":"5"} | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public void onCreate(Bundle savedInstanceState) { | ||
| 44 | + super.onCreate(savedInstanceState); | ||
| 45 | + setContentView(R.layout.cnstream_base_activity); | ||
| 46 | + | ||
| 47 | + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); | ||
| 48 | + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | ||
| 49 | + //初始化弹幕视图 间隔时间,行数,行弹幕最大值,速度(0.1-1.0) | ||
| 50 | + initTopBarrage(400, 2, 10, 0.5f); | ||
| 51 | + initBottomBarrage(400, 5, 10, 0.5f); | ||
| 52 | + //初始化聊天室 房间号,用户昵称 | ||
| 53 | + initChat(room, name); | ||
| 54 | + //初始化 设置是否有电影票 | ||
| 55 | + initStream(isMovie); | ||
| 56 | + | ||
| 57 | + //测试 | ||
| 58 | + button1 = (Button) findViewById(R.id.button1); | ||
| 59 | + button1.setOnClickListener(listener); | ||
| 60 | + button2 = (Button) findViewById(R.id.button2); | ||
| 61 | + button2.setOnClickListener(listener); | ||
| 62 | + button3 = (Button) findViewById(R.id.button3); | ||
| 63 | + button3.setOnClickListener(listener); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + private View.OnClickListener listener = new View.OnClickListener() { | ||
| 67 | + @Override | ||
| 68 | + public void onClick(View view) { | ||
| 69 | + switch (view.getId()) { | ||
| 70 | + case R.id.button1: | ||
| 71 | + List<ContributionInfo> list = new ArrayList<>(); | ||
| 72 | + list.add(new BaseContributionInfo("http://v1.qzone.cc/avatar/201403/23/11/54/532e5aefc546e496.jpg!200x200.jpg", "1")); | ||
| 73 | + list.add(new BaseContributionInfo("http://imgsrc.baidu.com/baike/pic/item/c2fdfc039245d6882d5d54d9a6c27d1ed21b2474.jpg", "2")); | ||
| 74 | + list.add(new BaseContributionInfo("http://img2.a0bi.com/upload/ttq/20160709/1468043314019.png", "1")); | ||
| 75 | + list.add(new BaseContributionInfo("http://b.hiphotos.baidu.com/zhidao/pic/item/d1a20cf431adcbefef0f982fabaf2edda3cc9fe4.jpg", "2")); | ||
| 76 | + list.add(new BaseContributionInfo("http://img2.a0bi.com/upload/ttq/20160817/1471399679901.png", "1")); | ||
| 77 | + list.add(new BaseContributionInfo("http://img2.a0bi.com/upload/ttq/20160709/1468043314019.png", "2")); | ||
| 78 | + updateContributionList(list); | ||
| 79 | + break; | ||
| 80 | + case R.id.button2: | ||
| 81 | + updateIncome(2334455); | ||
| 82 | + break; | ||
| 83 | + case R.id.button3: | ||
| 84 | + updateFollowCount(1122333); | ||
| 85 | + break; | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + }; | ||
| 89 | + | ||
| 90 | + | ||
| 91 | + @Override | ||
| 92 | + public void setStreamData() { | ||
| 93 | + //设置 直播节目 属性 | ||
| 94 | + cnBuilder.setActivityID(activityid); | ||
| 95 | + cnBuilder.setChannelID(channelid); | ||
| 96 | + cnBuilder.setIsHorizontalScreen(isHorizon); | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + @Override | ||
| 100 | + public void showEnd() { | ||
| 101 | +// //直播结束页面的数据 | ||
| 102 | + showEndView("123456", "123456"); | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + @Override | ||
| 106 | + public void closeButtonWhenNotInLiveClickListener() { | ||
| 107 | + //直播结束页面和直播页面(没有在直播状态中)的关闭按钮点击事件 | ||
| 108 | + super.closeButtonWhenNotInLiveClickListener(); | ||
| 109 | + finish(); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + @Override | ||
| 113 | + public void replayButtonClickListener() { | ||
| 114 | + //直播结束页的重播按钮点击事件 | ||
| 115 | + super.replayButtonClickListener(); | ||
| 116 | + finish(); | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + @Override | ||
| 120 | + public void backClickListener() { | ||
| 121 | + //重试页面返回按钮的点击事件 | ||
| 122 | + super.backClickListener(); | ||
| 123 | + finish(); | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + @Override | ||
| 127 | + public void onContributionListClick() { | ||
| 128 | + super.onContributionListClick(); | ||
| 129 | + Toast.makeText(this, "您点击了贡献榜", Toast.LENGTH_SHORT).show(); | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + @Override | ||
| 133 | + public void onStreamerState(int flag, String extra) { | ||
| 134 | + //推流状态信息,输出状态即可,与 initCNStreamError(int flag) 包含初始化失败状态 | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + @Override | ||
| 138 | + public void initCNStreamError(int flag) { | ||
| 139 | + //初始化CNStreamSDK失败,可能的原因是开启摄像头失败、转码失败、编码失败、 | ||
| 140 | + Log.e("DemoView", String.valueOf(flag)); | ||
| 141 | + switch (flag) { | ||
| 142 | + case IStreamer.cnstream_error_create_stream_server: | ||
| 143 | + //创建直播活动请求服务器失败 | ||
| 144 | + break; | ||
| 145 | + case IStreamer.cnstream_error_create_stream_network: | ||
| 146 | + //创建直播活动时网络连接失败 | ||
| 147 | + break; | ||
| 148 | + case IStreamer.cnstream_error_create_stream_other: | ||
| 149 | + //创建直播活动时失败 | ||
| 150 | + break; | ||
| 151 | + case IStreamer.cnstream_error_stop_stream: | ||
| 152 | + //停止直播活动失败 | ||
| 153 | + break; | ||
| 154 | + case IStreamer.cnstream_init_error_instop: | ||
| 155 | + //初始化失败 正在停止推流 | ||
| 156 | + break; | ||
| 157 | + case IStreamer.cnstream_error_dns_parse_failed: | ||
| 158 | + //url域名解析失败 | ||
| 159 | + break; | ||
| 160 | + case IStreamer.cnstream_error_av_async: | ||
| 161 | + //音视频采集pts差值超过5s 音视频采集pts具体差值,单位ms | ||
| 162 | + break; | ||
| 163 | + case IStreamer.cnstream_video_encoder_error_unsupported: | ||
| 164 | + //编码器初始化失败 | ||
| 165 | + break; | ||
| 166 | + case IStreamer.cnstream_video_encoder_error_unknown: | ||
| 167 | + //视频编码失败 | ||
| 168 | + break; | ||
| 169 | + case IStreamer.cnstream_audio_encoder_error_unsupported: | ||
| 170 | + //音频初始化失败 | ||
| 171 | + break; | ||
| 172 | + case IStreamer.cnstream_audio_encoder_error_unknown: | ||
| 173 | + //音频编码失败 | ||
| 174 | + break; | ||
| 175 | + case IStreamer.cnstream_audio_recorder_error_start_failed: | ||
| 176 | + //录音开启失败 | ||
| 177 | + break; | ||
| 178 | + case IStreamer.cnstream_audio_recorder_error_unknown: | ||
| 179 | + //录音开启未知错误 | ||
| 180 | + break; | ||
| 181 | + case IStreamer.cnstream_camera_error_unknown: | ||
| 182 | + //摄像头未知错误 | ||
| 183 | + break; | ||
| 184 | + case IStreamer.cnstream_camera_error_start_failed: | ||
| 185 | + //打开摄像头失败 | ||
| 186 | + break; | ||
| 187 | + case IStreamer.cnstream_camera_error_server_died: | ||
| 188 | + //系统Camera服务进程退出 | ||
| 189 | + break; | ||
| 190 | + } | ||
| 191 | +// finish(); | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + //聊天室事件监听 | ||
| 195 | + @Override | ||
| 196 | + public void onChatState(int what, String extra) { | ||
| 197 | + switch (what) { | ||
| 198 | + case ChatState.StateInitDone: //初始化完成 | ||
| 199 | + connectChat();//连接聊天室 | ||
| 200 | + break; | ||
| 201 | + case ChatState.ErrorInitAuth: //认证失败 | ||
| 202 | + case ChatState.ErrorInitNetwork: //未检测到网络 | ||
| 203 | + case ChatState.ErrorInitOther: //初始化错误 | ||
| 204 | + showMessage("聊天室初始化失败,点击重试", clickErrorInit);//设置错误信息 | ||
| 205 | + break; | ||
| 206 | + case ChatState.StateConnect: //与服务器建立连接 | ||
| 207 | + hideMessage();//隐藏错误信息 | ||
| 208 | + break; | ||
| 209 | + case ChatState.StateReconnect: //与服务器重新连接 | ||
| 210 | + hideMessage(); | ||
| 211 | + connectChat(); | ||
| 212 | + break; | ||
| 213 | + case ChatState.ErrorConnect: //连接服务器失败 | ||
| 214 | + case ChatState.ErrorChat: //聊天室连接失败 | ||
| 215 | + case ChatState.ErrorName: //昵称冲突 | ||
| 216 | + String message = "聊天室连接失败,点击重试"; | ||
| 217 | + SpannableString spannableString = new SpannableString(message); //定义文字样式 | ||
| 218 | + spannableString.setSpan(new UnderlineSpan(), message.length() - 2, message.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); | ||
| 219 | + spannableString.setSpan(new ForegroundColorSpan(Color.rgb(255, 213, 0)), message.length() - 2, message.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); | ||
| 220 | + showMessage(spannableString, clickErrorConnect);//设置错误信息 | ||
| 221 | + break; | ||
| 222 | + case ChatState.ErrorConnectCloseOnError: //聊天室异常断开 | ||
| 223 | + showMessage("聊天室已断开,请检查网络"); | ||
| 224 | + break; | ||
| 225 | + case ChatState.ErrorSendOther: //消息发送失败 | ||
| 226 | + //TODO Toast提示 | ||
| 227 | + break; | ||
| 228 | + case ChatState.ErrorSendNoConnect: //消息发送失败 没有连接聊天室 | ||
| 229 | + //TODO Toast提示 | ||
| 230 | + break; | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + //聊天室连接失败 点击事件 | ||
| 235 | + protected View.OnClickListener clickErrorConnect = new View.OnClickListener() { | ||
| 236 | + @Override | ||
| 237 | + public void onClick(View v) { | ||
| 238 | + v.setOnClickListener(null); | ||
| 239 | + connectChat(); | ||
| 240 | + } | ||
| 241 | + }; | ||
| 242 | + | ||
| 243 | + //聊天室初始化失败 点击事件 | ||
| 244 | + protected View.OnClickListener clickErrorInit = new View.OnClickListener() { | ||
| 245 | + @Override | ||
| 246 | + public void onClick(View v) { | ||
| 247 | + v.setOnClickListener(null); | ||
| 248 | + initChat(room, name); | ||
| 249 | + } | ||
| 250 | + }; | ||
| 251 | +} |
app/src/main/jniLibs/arm64-v8a/libksylive.so
0 → 100644
No preview for this file type
app/src/main/jniLibs/armeabi-v7a/libksylive.so
0 → 100644
No preview for this file type
app/src/main/jniLibs/x86/libksylive.so
0 → 100644
No preview for this file type
app/src/main/res/drawable-xhdpi/cnlive_anchor_info.png
0 → 100644
18.1 KB
app/src/main/res/drawable-xhdpi/cnlive_avatar.png
0 → 100644
1.41 KB
app/src/main/res/drawable-xhdpi/cnlive_bottom_bg.png
0 → 100644
1.26 KB
app/src/main/res/drawable-xhdpi/cnlive_chat_btn_bg.9.png
0 → 100644
137 Bytes
app/src/main/res/drawable-xhdpi/cnlive_chat_line.png
0 → 100644
1006 Bytes
app/src/main/res/drawable-xhdpi/cnlive_close.png
0 → 100644
33.7 KB
app/src/main/res/drawable-xhdpi/cnlive_flay_kiss_big.png
0 → 100644
20.8 KB
app/src/main/res/drawable-xhdpi/cnlive_fullscreen_l.png
0 → 100644
1.5 KB
app/src/main/res/drawable-xhdpi/cnlive_fullscreen_p.png
0 → 100644
1.46 KB
app/src/main/res/drawable-xhdpi/cnlive_input_bg.9.png
0 → 100644
136 Bytes
app/src/main/res/drawable-xhdpi/cnlive_online_avatar.png
0 → 100644
33.9 KB
app/src/main/res/drawable-xhdpi/cnlive_pause.png
0 → 100644
17.5 KB
app/src/main/res/drawable-xhdpi/cnlive_play.png
0 → 100644
17.9 KB
app/src/main/res/drawable-xhdpi/cnlive_replay.png
0 → 100644
19.4 KB
app/src/main/res/drawable-xhdpi/cnlive_send_bg.9.png
0 → 100644
142 Bytes
app/src/main/res/drawable-xhdpi/cnlive_switch_close.png
0 → 100644
2.46 KB
app/src/main/res/drawable-xhdpi/cnlive_switch_open.png
0 → 100644
2.44 KB
app/src/main/res/drawable-xhdpi/cnlive_ticket.png
0 → 100644
34.3 KB
app/src/main/res/drawable-xhdpi/cnlive_video_back.png
0 → 100644
1.36 KB
app/src/main/res/drawable-xhdpi/cnlive_video_bottom_bg.png
0 → 100644
1.06 KB
app/src/main/res/drawable-xhdpi/cnlive_video_share.png
0 → 100644
1.46 KB
app/src/main/res/drawable-xhdpi/cnlive_video_top_bg.png
0 → 100644
1.07 KB
app/src/main/res/drawable-xxhdpi/cnlive_avatar.png
0 → 100644
1.63 KB
app/src/main/res/drawable-xxhdpi/cnlive_avatar2.png
0 → 100644
1.76 KB
app/src/main/res/drawable-xxhdpi/cnlive_bottom_bg.png
0 → 100644
1.38 KB
app/src/main/res/drawable-xxhdpi/cnlive_chat_btn_bg.9.png
0 → 100644
181 Bytes
app/src/main/res/drawable-xxhdpi/cnlive_chat_off.9.png
0 → 100644
182 Bytes
app/src/main/res/drawable-xxhdpi/cnlive_chat_on.9.png
0 → 100644
378 Bytes
app/src/main/res/drawable-xxhdpi/cnlive_flay_kiss_big.png
0 → 100644
20.9 KB
app/src/main/res/drawable-xxhdpi/cnlive_fullscreen_l.png
0 → 100644
1.83 KB
app/src/main/res/drawable-xxhdpi/cnlive_fullscreen_p.png
0 → 100644
1.78 KB
app/src/main/res/drawable-xxhdpi/cnlive_input_bg.9.png
0 → 100644
186 Bytes
app/src/main/res/drawable-xxhdpi/cnlive_popup_bg.9.png
0 → 100644
935 Bytes
app/src/main/res/drawable-xxhdpi/cnlive_send_bg.9.png
0 → 100644
190 Bytes
app/src/main/res/drawable-xxhdpi/cnlive_switch_close.png
0 → 100644
3.34 KB
app/src/main/res/drawable-xxhdpi/cnlive_switch_open.png
0 → 100644
3.24 KB
app/src/main/res/drawable-xxhdpi/cnlive_video_back.png
0 → 100644
1.65 KB
app/src/main/res/drawable-xxhdpi/cnlive_video_bottom_bg.png
0 → 100644
1.34 KB
app/src/main/res/drawable-xxhdpi/cnlive_video_brightness_bg.png
0 → 100644
3.48 KB
app/src/main/res/drawable-xxhdpi/cnlive_video_num_bg.9.png
0 → 100644
131 Bytes
app/src/main/res/drawable-xxhdpi/cnlive_video_num_front.9.png
0 → 100644
171 Bytes
app/src/main/res/drawable-xxhdpi/cnlive_video_share.png
0 → 100644
1.68 KB
app/src/main/res/drawable-xxhdpi/cnlive_video_top_bg.png
0 → 100644
1.35 KB
app/src/main/res/drawable-xxhdpi/cnlive_video_volumn_bg.png
0 → 100644
3.42 KB
app/src/main/res/drawable-xxhdpi/cnstream_audience.png
0 → 100644
34.2 KB
app/src/main/res/drawable-xxhdpi/cnstream_back.png
0 → 100644
17.8 KB
app/src/main/res/drawable-xxhdpi/cnstream_close.png
0 → 100644
33.7 KB
app/src/main/res/drawable-xxhdpi/cnstream_duration.png
0 → 100644
34.3 KB
app/src/main/res/drawable-xxhdpi/cnstream_logo01.png
0 → 100644
25.4 KB
app/src/main/res/drawable-xxhdpi/cnstream_logo02.png
0 → 100644
37.3 KB
app/src/main/res/drawable-xxhdpi/cnstream_presell.png
0 → 100644
34.2 KB
app/src/main/res/drawable-xxhdpi/cnstream_replay.png
0 → 100644
19.4 KB
app/src/main/res/drawable-xxhdpi/cnstream_start_background.png
0 → 100644
503 KB
app/src/main/res/drawable-xxhdpi/cnstream_switch_camera.png
0 → 100644
18.3 KB
app/src/main/res/drawable/cnlive_chat_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_chat_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape | ||
| 3 | + xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | + android:shape="rectangle" | ||
| 5 | + android:useLevel="false"> | ||
| 6 | + <solid android:color="@color/colorChatItem" /> | ||
| 7 | + <corners | ||
| 8 | + android:bottomLeftRadius="8dp" | ||
| 9 | + android:bottomRightRadius="8dp" | ||
| 10 | + android:topLeftRadius="8dp" | ||
| 11 | + android:topRightRadius="8dp" /> | ||
| 12 | +</shape> | ||
| 0 | \ No newline at end of file | 13 | \ No newline at end of file |
app/src/main/res/drawable/cnlive_chat_gift_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_chat_gift_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:shape="rectangle" | ||
| 4 | + android:useLevel="false"> | ||
| 5 | + <solid android:color="@color/anchor_black_bg" /> | ||
| 6 | + <size android:height="24dp" /> | ||
| 7 | + <corners | ||
| 8 | + android:bottomLeftRadius="0dp" | ||
| 9 | + android:bottomRightRadius="8dp" | ||
| 10 | + android:topLeftRadius="0dp" | ||
| 11 | + android:topRightRadius="8dp" /> <!-- 设置四个角的半径 --> | ||
| 12 | + | ||
| 13 | +</shape> | ||
| 0 | \ No newline at end of file | 14 | \ No newline at end of file |
app/src/main/res/drawable/cnlive_chat_icon_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_chat_icon_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | + | ||
| 3 | +<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 4 | + <corners android:radius="80dp" /> | ||
| 5 | + <solid android:color="@color/colorWhite" /> | ||
| 6 | + <stroke | ||
| 7 | + android:width="1dp" | ||
| 8 | + android:color="@color/Yellow_1" /> | ||
| 9 | + <size | ||
| 10 | + android:width="80dp" | ||
| 11 | + android:height="80dp" /> | ||
| 12 | +</shape> | ||
| 0 | \ No newline at end of file | 13 | \ No newline at end of file |
app/src/main/res/drawable/cnlive_dialog_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_dialog_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape | ||
| 3 | + xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | + android:shape="rectangle" | ||
| 5 | + android:useLevel="false"> | ||
| 6 | + <solid android:color="#efefef" /> | ||
| 7 | + | ||
| 8 | + <corners | ||
| 9 | + android:bottomLeftRadius="16dp" | ||
| 10 | + android:bottomRightRadius="16dp" | ||
| 11 | + android:topLeftRadius="16dp" | ||
| 12 | + android:topRightRadius="16dp" /> <!-- 设置四个角的半径 --> | ||
| 13 | + | ||
| 14 | +</shape> | ||
| 0 | \ No newline at end of file | 15 | \ No newline at end of file |
app/src/main/res/drawable/cnlive_seekbar.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_seekbar.xml | ||
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + | ||
| 4 | + <item android:id="@android:id/background"> | ||
| 5 | + <shape> | ||
| 6 | + <corners android:radius="2dip" /> | ||
| 7 | + <solid android:color="#66ffffff" /> | ||
| 8 | + </shape> | ||
| 9 | + </item> | ||
| 10 | + | ||
| 11 | + <item android:id="@android:id/secondaryProgress"> | ||
| 12 | + <scale android:scaleWidth="100%"> | ||
| 13 | + <shape> | ||
| 14 | + <corners android:radius="2dip" /> | ||
| 15 | + <solid android:color="#00ffffff" /> | ||
| 16 | + </shape> | ||
| 17 | + </scale> | ||
| 18 | + | ||
| 19 | + </item> | ||
| 20 | + | ||
| 21 | + <item android:id="@android:id/progress"> | ||
| 22 | + <clip> | ||
| 23 | + <scale android:scaleWidth="100%"> | ||
| 24 | + <shape> | ||
| 25 | + <corners android:radius="2dip" /> | ||
| 26 | + <solid android:color="#ffd500" /> | ||
| 27 | + </shape> | ||
| 28 | + </scale> | ||
| 29 | + </clip> | ||
| 30 | + </item> | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +</layer-list> | ||
| 0 | \ No newline at end of file | 34 | \ No newline at end of file |
app/src/main/res/drawable/cnlive_seekbar_progress.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_seekbar_progress.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:shape="rectangle"> | ||
| 4 | + <solid android:color="#ffffff" /> | ||
| 5 | + <corners android:radius="6dp" /> | ||
| 6 | + | ||
| 7 | + <size | ||
| 8 | + android:width="12dp" | ||
| 9 | + android:height="12dp" /> | ||
| 10 | +</shape> | ||
| 0 | \ No newline at end of file | 11 | \ No newline at end of file |
app/src/main/res/drawable/cnlive_support_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_support_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape | ||
| 3 | + xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | + android:shape="oval" | ||
| 5 | + android:useLevel="false"> | ||
| 6 | + <solid android:color="#fe5e5f" /> | ||
| 7 | + <size | ||
| 8 | + android:width="45dp" | ||
| 9 | + android:height="45dp" /> | ||
| 10 | + | ||
| 11 | +</shape> | ||
| 0 | \ No newline at end of file | 12 | \ No newline at end of file |
app/src/main/res/drawable/cnlive_switch_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_switch_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + <item android:drawable="@drawable/cnlive_switch_open" android:state_checked="true" /> | ||
| 4 | + <item android:drawable="@drawable/cnlive_switch_close" android:state_checked="false" /> | ||
| 5 | +</selector> | ||
| 0 | \ No newline at end of file | 6 | \ No newline at end of file |
app/src/main/res/drawable/cnlive_ugc_retry_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/cnlive_ugc_retry_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:shape="rectangle" | ||
| 4 | + android:useLevel="false"> | ||
| 5 | + | ||
| 6 | + <stroke | ||
| 7 | + android:width="1dp" | ||
| 8 | + android:color="@android:color/white" /> | ||
| 9 | + | ||
| 10 | + <corners | ||
| 11 | + android:bottomLeftRadius="20dp" | ||
| 12 | + android:bottomRightRadius="20dp" | ||
| 13 | + android:topLeftRadius="20dp" | ||
| 14 | + android:topRightRadius="20dp" /> | ||
| 15 | + | ||
| 16 | + <size android:height="40dp" | ||
| 17 | + android:width="160dp"/> | ||
| 18 | + | ||
| 19 | +</shape> | ||
| 0 | \ No newline at end of file | 20 | \ No newline at end of file |
app/src/main/res/drawable/stream_dialog_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/stream_dialog_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape | ||
| 3 | + xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | + android:shape="rectangle" | ||
| 5 | + android:useLevel="false"> | ||
| 6 | + <solid android:color="#eeeeee" /> | ||
| 7 | + | ||
| 8 | + <corners | ||
| 9 | + android:bottomLeftRadius="10dp" | ||
| 10 | + android:bottomRightRadius="10dp" | ||
| 11 | + android:topLeftRadius="10dp" | ||
| 12 | + android:topRightRadius="10dp" /> <!-- 设置四个角的半径 --> | ||
| 13 | + | ||
| 14 | +</shape> | ||
| 0 | \ No newline at end of file | 15 | \ No newline at end of file |
app/src/main/res/drawable/stream_start_live_text_bg.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/stream_start_live_text_bg.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + <item android:drawable="@drawable/stream_start_live_text_bg_pressed" android:state_pressed="true" /> | ||
| 4 | + <item android:drawable="@drawable/stream_start_live_text_bg_normal" android:state_pressed="false" /> | ||
| 5 | +</selector> | ||
| 0 | \ No newline at end of file | 6 | \ No newline at end of file |
app/src/main/res/drawable/stream_start_live_text_bg_normal.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/stream_start_live_text_bg_normal.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape | ||
| 3 | + xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | + android:shape="rectangle"> | ||
| 5 | + <stroke android:width="0.5dp" | ||
| 6 | + android:color="#ffffff"/> | ||
| 7 | + <corners | ||
| 8 | + android:radius="30dp" /> | ||
| 9 | +</shape> | ||
| 0 | \ No newline at end of file | 10 | \ No newline at end of file |
app/src/main/res/drawable/stream_start_live_text_bg_pressed.xml
0 → 100644
| 1 | +++ a/app/src/main/res/drawable/stream_start_live_text_bg_pressed.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<shape | ||
| 3 | + xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | + android:shape="rectangle"> | ||
| 5 | + <solid android:color="#66ffffff" /> | ||
| 6 | + <stroke android:width="0.5dp" | ||
| 7 | + android:color="#66ffffff"/> | ||
| 8 | + <corners android:radius="30dp" /> | ||
| 9 | +</shape> | ||
| 0 | \ No newline at end of file | 10 | \ No newline at end of file |
app/src/main/res/layout/activity_barrage.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/activity_barrage.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:layout_width="match_parent" | ||
| 4 | + android:layout_height="match_parent"> | ||
| 5 | + | ||
| 6 | + <Button | ||
| 7 | + android:id="@+id/addMessage" | ||
| 8 | + android:layout_width="wrap_content" | ||
| 9 | + android:layout_height="wrap_content" | ||
| 10 | + android:text="add Message"/> | ||
| 11 | + <Button | ||
| 12 | + android:id="@+id/addGift" | ||
| 13 | + android:layout_width="wrap_content" | ||
| 14 | + android:layout_height="wrap_content" | ||
| 15 | + android:layout_below="@+id/addMessage" | ||
| 16 | + android:text="add Gift"/> | ||
| 17 | + | ||
| 18 | + <com.cnlive.libs.video.barrage.BarrageLayout | ||
| 19 | + android:id="@+id/gift" | ||
| 20 | + android:layout_width="match_parent" | ||
| 21 | + android:layout_height="wrap_content" | ||
| 22 | + android:layout_below="@+id/addGift" | ||
| 23 | + android:background="#ff377757" /> | ||
| 24 | + | ||
| 25 | + <com.cnlive.libs.video.barrage.BarrageLayout | ||
| 26 | + android:id="@+id/barrage" | ||
| 27 | + android:layout_width="match_parent" | ||
| 28 | + android:layout_height="wrap_content" | ||
| 29 | + android:layout_alignParentBottom="true" | ||
| 30 | + android:background="#ff777757" /> | ||
| 31 | + | ||
| 32 | +</RelativeLayout> | ||
| 0 | \ No newline at end of file | 33 | \ No newline at end of file |
app/src/main/res/layout/activity_chat.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/activity_chat.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="match_parent"> | ||
| 6 | + | ||
| 7 | + <Button | ||
| 8 | + android:id="@+id/send" | ||
| 9 | + android:layout_width="wrap_content" | ||
| 10 | + android:layout_height="wrap_content" | ||
| 11 | + android:text="send"/> | ||
| 12 | + | ||
| 13 | + <TextView | ||
| 14 | + android:id="@+id/chat_state" | ||
| 15 | + android:layout_width="match_parent" | ||
| 16 | + android:layout_height="32dp" | ||
| 17 | + android:layout_alignParentBottom="true" | ||
| 18 | + android:background="#85000000" | ||
| 19 | + android:gravity="center_vertical" | ||
| 20 | + android:paddingLeft="8dp" | ||
| 21 | + android:textColor="@android:color/white" | ||
| 22 | + android:textSize="14sp" | ||
| 23 | + tools:text="聊天室状态" /> | ||
| 24 | + | ||
| 25 | +</RelativeLayout> | ||
| 0 | \ No newline at end of file | 26 | \ No newline at end of file |
app/src/main/res/layout/activity_main.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/activity_main.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="match_parent" | ||
| 6 | + android:orientation="vertical" | ||
| 7 | + android:paddingBottom="@dimen/activity_vertical_margin" | ||
| 8 | + android:paddingLeft="@dimen/activity_horizontal_margin" | ||
| 9 | + android:paddingRight="@dimen/activity_horizontal_margin" | ||
| 10 | + android:paddingTop="@dimen/activity_vertical_margin" | ||
| 11 | + tools:context="com.cnlive.cnvideodemo.com.wepiao.cnvideodemo.MainActivity"> | ||
| 12 | + | ||
| 13 | + <Button | ||
| 14 | + android:id="@+id/click_player_live" | ||
| 15 | + android:layout_width="wrap_content" | ||
| 16 | + android:layout_height="wrap_content" | ||
| 17 | + android:onClick="onClick" | ||
| 18 | + android:layout_margin="4dp" | ||
| 19 | + android:text="直播页面" /> | ||
| 20 | + | ||
| 21 | + <Button | ||
| 22 | + android:id="@+id/click_player_ugc_live" | ||
| 23 | + android:layout_width="wrap_content" | ||
| 24 | + android:layout_height="wrap_content" | ||
| 25 | + android:onClick="onClick" | ||
| 26 | + android:layout_margin="4dp" | ||
| 27 | + android:text="UGC直播页面" /> | ||
| 28 | + | ||
| 29 | + <Button | ||
| 30 | + android:id="@+id/click_player_ugc_vod" | ||
| 31 | + android:layout_width="wrap_content" | ||
| 32 | + android:layout_height="wrap_content" | ||
| 33 | + android:onClick="onClick" | ||
| 34 | + android:layout_margin="4dp" | ||
| 35 | + android:text="UGC点播页面" /> | ||
| 36 | + | ||
| 37 | + <Button | ||
| 38 | + android:id="@+id/click_player_ugc_stream" | ||
| 39 | + android:layout_width="wrap_content" | ||
| 40 | + android:layout_height="wrap_content" | ||
| 41 | + android:onClick="onClick" | ||
| 42 | + android:layout_margin="4dp" | ||
| 43 | + android:text="直播推流" /> | ||
| 44 | +</LinearLayout> |
app/src/main/res/layout/cnlive_activity_player.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_activity_player.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:layout_width="match_parent" | ||
| 4 | + android:layout_height="match_parent" | ||
| 5 | + android:background="#ff3f3f3f" | ||
| 6 | + android:orientation="vertical"> | ||
| 7 | + | ||
| 8 | + | ||
| 9 | + <com.cnlive.lib_cnvideo.ui.widget.player.CNMediaPlayer | ||
| 10 | + android:id="@+id/cnlivePlayer" | ||
| 11 | + android:layout_width="match_parent" | ||
| 12 | + android:layout_height="wrap_content" /> | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + <com.cnlive.libs.video.barrage.BarrageLayout | ||
| 16 | + android:id="@+id/barrageLayout" | ||
| 17 | + android:layout_width="match_parent" | ||
| 18 | + android:layout_height="match_parent" | ||
| 19 | + android:layout_alignBottom="@+id/cnlivePlayer" | ||
| 20 | + android:layout_alignTop="@+id/cnlivePlayer" | ||
| 21 | + android:layout_marginBottom="58dp" | ||
| 22 | + android:layout_marginTop="58dp" | ||
| 23 | + android:visibility="gone" /> | ||
| 24 | + | ||
| 25 | + <com.cnlive.lib_cnvideo.ui.widget.player.CNTouchView | ||
| 26 | + android:id="@+id/playerTouch" | ||
| 27 | + android:layout_width="match_parent" | ||
| 28 | + android:layout_height="match_parent" | ||
| 29 | + android:layout_alignBottom="@+id/cnlivePlayer" | ||
| 30 | + android:layout_alignTop="@+id/cnlivePlayer" /> | ||
| 31 | + | ||
| 32 | + <com.cnlive.lib_cnvideo.ui.widget.player.CNInfoView | ||
| 33 | + android:id="@+id/playerInfo" | ||
| 34 | + android:layout_width="match_parent" | ||
| 35 | + android:layout_height="match_parent" | ||
| 36 | + android:layout_alignBottom="@+id/cnlivePlayer" | ||
| 37 | + android:layout_alignTop="@+id/cnlivePlayer" /> | ||
| 38 | + | ||
| 39 | + <RelativeLayout | ||
| 40 | + android:id="@+id/controllerLayout" | ||
| 41 | + android:layout_width="match_parent" | ||
| 42 | + android:layout_height="wrap_content" | ||
| 43 | + android:layout_alignBottom="@+id/cnlivePlayer" | ||
| 44 | + android:layout_alignTop="@+id/cnlivePlayer"> | ||
| 45 | + | ||
| 46 | + <include layout="@layout/cnlive_layout_controller" /> | ||
| 47 | + | ||
| 48 | + </RelativeLayout> | ||
| 49 | + | ||
| 50 | + <ImageView | ||
| 51 | + android:id="@+id/back" | ||
| 52 | + android:layout_width="40dp" | ||
| 53 | + android:layout_height="40dp" | ||
| 54 | + android:layout_marginLeft="3dp" | ||
| 55 | + android:padding="11dp" | ||
| 56 | + android:scaleType="fitCenter" | ||
| 57 | + android:src="@drawable/cnlive_video_back" /> | ||
| 58 | + | ||
| 59 | + <LinearLayout | ||
| 60 | + android:id="@+id/bottomParentLayout" | ||
| 61 | + android:layout_width="match_parent" | ||
| 62 | + android:layout_height="match_parent" | ||
| 63 | + android:layout_below="@+id/cnlivePlayer"> | ||
| 64 | + | ||
| 65 | + <RelativeLayout | ||
| 66 | + android:id="@+id/bottomLayout" | ||
| 67 | + android:layout_width="match_parent" | ||
| 68 | + android:layout_height="380dp"> | ||
| 69 | + | ||
| 70 | + <android.support.v7.widget.RecyclerView | ||
| 71 | + android:id="@+id/chat_message" | ||
| 72 | + android:layout_width="match_parent" | ||
| 73 | + android:layout_height="match_parent" | ||
| 74 | + android:layout_above="@+id/line"/> | ||
| 75 | + | ||
| 76 | + <View | ||
| 77 | + android:layout_width="match_parent" | ||
| 78 | + android:layout_height="159dp" | ||
| 79 | + android:layout_alignParentBottom="true" | ||
| 80 | + android:background="@drawable/cnlive_bottom_bg" /> | ||
| 81 | + | ||
| 82 | + <TextView | ||
| 83 | + android:id="@+id/retryText" | ||
| 84 | + android:layout_width="match_parent" | ||
| 85 | + android:layout_height="42dp" | ||
| 86 | + android:layout_above="@+id/line" | ||
| 87 | + android:background="@color/colorRetry" | ||
| 88 | + android:gravity="center_vertical" | ||
| 89 | + android:paddingLeft="25dp" | ||
| 90 | + android:textColor="@color/colorWhite" | ||
| 91 | + android:textSize="14dp" /> | ||
| 92 | + | ||
| 93 | + <View | ||
| 94 | + android:id="@+id/line" | ||
| 95 | + android:layout_width="345dp" | ||
| 96 | + android:layout_height="0.5dp" | ||
| 97 | + android:layout_above="@+id/inputBtnBottom" | ||
| 98 | + android:layout_centerHorizontal="true" | ||
| 99 | + android:layout_marginBottom="15dp" | ||
| 100 | + android:layout_marginTop="15dp" | ||
| 101 | + android:background="@drawable/cnlive_chat_line" /> | ||
| 102 | + | ||
| 103 | + <TextView | ||
| 104 | + android:id="@+id/inputBtnBottom" | ||
| 105 | + android:layout_width="345dp" | ||
| 106 | + android:layout_height="35dp" | ||
| 107 | + android:layout_alignParentBottom="true" | ||
| 108 | + android:layout_centerHorizontal="true" | ||
| 109 | + android:layout_marginBottom="15dp" | ||
| 110 | + android:background="@drawable/cnlive_chat_btn_bg" | ||
| 111 | + android:gravity="center" | ||
| 112 | + android:text="说点什么..." | ||
| 113 | + android:textColor="@android:color/white" | ||
| 114 | + android:textSize="14dp" /> | ||
| 115 | + | ||
| 116 | + </RelativeLayout> | ||
| 117 | + </LinearLayout> | ||
| 118 | + | ||
| 119 | + <RelativeLayout | ||
| 120 | + android:id="@+id/foregroundLayout" | ||
| 121 | + android:layout_width="match_parent" | ||
| 122 | + android:layout_height="match_parent" | ||
| 123 | + android:fitsSystemWindows="true" /> | ||
| 124 | + | ||
| 125 | + | ||
| 126 | + <!--<Button--> | ||
| 127 | + <!--android:id="@+id/test"--> | ||
| 128 | + <!--android:layout_width="wrap_content"--> | ||
| 129 | + <!--android:layout_height="wrap_content" />--> | ||
| 130 | +</RelativeLayout> |
app/src/main/res/layout/cnlive_activity_ugc_player.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_activity_ugc_player.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:layout_width="match_parent" | ||
| 4 | + android:layout_height="match_parent" | ||
| 5 | + android:orientation="vertical"> | ||
| 6 | + | ||
| 7 | + <RelativeLayout | ||
| 8 | + android:id="@+id/main" | ||
| 9 | + android:layout_width="match_parent" | ||
| 10 | + android:layout_height="match_parent"/> | ||
| 11 | + | ||
| 12 | + <RelativeLayout | ||
| 13 | + android:id="@+id/foregroundLayout" | ||
| 14 | + android:layout_width="match_parent" | ||
| 15 | + android:layout_height="match_parent" /> | ||
| 16 | + | ||
| 17 | + <Button | ||
| 18 | + android:id="@+id/test1" | ||
| 19 | + android:layout_width="wrap_content" | ||
| 20 | + android:layout_height="wrap_content" | ||
| 21 | + android:text="更新贡献榜列表测试" | ||
| 22 | + android:layout_marginTop="200dp"/> | ||
| 23 | + | ||
| 24 | + <Button | ||
| 25 | + android:id="@+id/test2" | ||
| 26 | + android:layout_width="wrap_content" | ||
| 27 | + android:layout_height="wrap_content" | ||
| 28 | + android:text="更新预售票房或收到飞吻测试" | ||
| 29 | + android:layout_below="@+id/test1"/> | ||
| 30 | + | ||
| 31 | + <Button | ||
| 32 | + android:id="@+id/test3" | ||
| 33 | + android:layout_width="wrap_content" | ||
| 34 | + android:layout_height="wrap_content" | ||
| 35 | + android:text="更新在线人数测试" | ||
| 36 | + android:layout_below="@+id/test2"/> | ||
| 37 | + | ||
| 38 | +</RelativeLayout> |
app/src/main/res/layout/cnlive_dialog.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_dialog.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:layout_width="256dp" | ||
| 4 | + android:layout_height="wrap_content" | ||
| 5 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 6 | + android:background="@drawable/cnlive_dialog_bg" | ||
| 7 | + android:orientation="vertical"> | ||
| 8 | + | ||
| 9 | + <TextView | ||
| 10 | + android:id="@+id/title" | ||
| 11 | + android:layout_width="wrap_content" | ||
| 12 | + android:layout_height="wrap_content" | ||
| 13 | + android:layout_gravity="center_horizontal" | ||
| 14 | + android:layout_marginBottom="4dp" | ||
| 15 | + android:layout_marginTop="20dp" | ||
| 16 | + tools:text="title" | ||
| 17 | + android:layout_marginRight="10dp" | ||
| 18 | + android:layout_marginLeft="10dp" | ||
| 19 | + android:textColor="@android:color/black" | ||
| 20 | + android:textSize="16sp"/> | ||
| 21 | + | ||
| 22 | + <TextView | ||
| 23 | + android:id="@+id/content" | ||
| 24 | + android:layout_width="wrap_content" | ||
| 25 | + android:layout_height="wrap_content" | ||
| 26 | + android:layout_gravity="center_horizontal" | ||
| 27 | + android:layout_marginBottom="20dp" | ||
| 28 | + android:layout_marginTop="4dp" | ||
| 29 | + tools:text="content" | ||
| 30 | + android:layout_marginRight="10dp" | ||
| 31 | + android:layout_marginLeft="10dp" | ||
| 32 | + android:textColor="@android:color/black" | ||
| 33 | + android:textSize="12sp" /> | ||
| 34 | + | ||
| 35 | + <View | ||
| 36 | + android:layout_width="match_parent" | ||
| 37 | + android:layout_height="1px" | ||
| 38 | + android:background="@color/Gray_1" /> | ||
| 39 | + | ||
| 40 | + <LinearLayout | ||
| 41 | + android:layout_width="match_parent" | ||
| 42 | + android:layout_height="42dp" | ||
| 43 | + android:orientation="horizontal"> | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + <TextView | ||
| 47 | + android:id="@+id/btn" | ||
| 48 | + android:layout_width="0dp" | ||
| 49 | + android:layout_height="match_parent" | ||
| 50 | + android:gravity="center" | ||
| 51 | + android:paddingBottom="10dp" | ||
| 52 | + android:paddingTop="10dp" | ||
| 53 | + tools:text="OK" | ||
| 54 | + android:textColor="#177bdf" | ||
| 55 | + android:textSize="14sp" | ||
| 56 | + android:layout_weight="1"/> | ||
| 57 | + | ||
| 58 | + </LinearLayout> | ||
| 59 | + | ||
| 60 | +</LinearLayout> | ||
| 0 | \ No newline at end of file | 61 | \ No newline at end of file |
app/src/main/res/layout/cnlive_fragment_input.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_fragment_input.xml | ||
| 1 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | + xmlns:emojicon="http://schemas.android.com/tools" | ||
| 3 | + android:id="@+id/layout" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="match_parent" | ||
| 6 | + android:orientation="vertical"> | ||
| 7 | + | ||
| 8 | + <View | ||
| 9 | + android:id="@+id/click_view" | ||
| 10 | + android:layout_width="match_parent" | ||
| 11 | + android:layout_height="0dp" | ||
| 12 | + android:layout_weight="1"/> | ||
| 13 | + | ||
| 14 | + <RelativeLayout | ||
| 15 | + android:id="@+id/anchorInputParentLayout" | ||
| 16 | + android:layout_width="match_parent" | ||
| 17 | + android:layout_height="45dp" | ||
| 18 | + android:layout_below="@+id/click_view" | ||
| 19 | + android:layout_gravity="bottom" | ||
| 20 | + android:paddingLeft="15dp" | ||
| 21 | + android:background="@android:color/white"> | ||
| 22 | + | ||
| 23 | + <com.cnlive.libs.util.ui.emojicon.EmojiconEditText | ||
| 24 | + android:id="@+id/chatEditText" | ||
| 25 | + android:layout_width="match_parent" | ||
| 26 | + android:layout_height="35dp" | ||
| 27 | + android:gravity="center_vertical" | ||
| 28 | + android:imeOptions="flagNoFullscreen|flagNoExtractUi|actionSend" | ||
| 29 | + android:inputType="textLongMessage" | ||
| 30 | + android:paddingLeft="11dp" | ||
| 31 | + android:textSize="14dp" | ||
| 32 | + android:hint="说点什么吧..." | ||
| 33 | + android:textColor="@color/Gray_2" | ||
| 34 | + emojicon:emojiconSize="15sp" | ||
| 35 | + android:layout_weight="1" | ||
| 36 | + android:layout_centerVertical="true" | ||
| 37 | + android:layout_toLeftOf="@+id/chatSend" | ||
| 38 | + android:background="@drawable/cnlive_input_bg"/> | ||
| 39 | + | ||
| 40 | + <TextView | ||
| 41 | + android:id="@+id/chatSend" | ||
| 42 | + android:layout_width="70dp" | ||
| 43 | + android:layout_height="35dp" | ||
| 44 | + android:text="发送" | ||
| 45 | + android:gravity="center" | ||
| 46 | + android:layout_marginLeft="5dp" | ||
| 47 | + android:layout_marginRight="15dp" | ||
| 48 | + android:textSize="15dp" | ||
| 49 | + android:textColor="@color/Gray_1" | ||
| 50 | + android:layout_alignParentRight="true" | ||
| 51 | + android:layout_centerVertical="true" | ||
| 52 | + android:background="@drawable/cnlive_send_bg"/> | ||
| 53 | + | ||
| 54 | + </RelativeLayout> | ||
| 55 | + | ||
| 56 | +</LinearLayout> | ||
| 0 | \ No newline at end of file | 57 | \ No newline at end of file |
app/src/main/res/layout/cnlive_fragment_ugc_live_player.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_fragment_ugc_live_player.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="match_parent" | ||
| 6 | + android:orientation="vertical"> | ||
| 7 | + | ||
| 8 | + <com.cnlive.lib_cnvideo.ui.widget.player.CNMediaPlayer | ||
| 9 | + android:id="@+id/cnlivePlayer" | ||
| 10 | + android:layout_width="match_parent" | ||
| 11 | + android:layout_height="match_parent" /> | ||
| 12 | + | ||
| 13 | + <View | ||
| 14 | + android:layout_width="match_parent" | ||
| 15 | + android:layout_height="159dp" | ||
| 16 | + android:background="@drawable/cnlive_video_top_bg"/> | ||
| 17 | + | ||
| 18 | + <include layout="@layout/cnlive_layout_player_anchor_info" /> | ||
| 19 | + | ||
| 20 | + <View | ||
| 21 | + android:layout_width="match_parent" | ||
| 22 | + android:layout_height="159dp" | ||
| 23 | + android:background="@drawable/cnlive_video_bottom_bg" | ||
| 24 | + android:layout_alignBottom="@+id/bottomLayout"/> | ||
| 25 | + | ||
| 26 | + <com.cnlive.libs.video.barrage.BarrageLayout | ||
| 27 | + android:id="@+id/topBarrage" | ||
| 28 | + android:layout_width="match_parent" | ||
| 29 | + android:layout_height="wrap_content" | ||
| 30 | + android:layout_below="@+id/anchorAboutLayout" /> | ||
| 31 | + | ||
| 32 | + <com.cnlive.libs.video.barrage.BarrageLayout | ||
| 33 | + android:id="@+id/bottomBarrage" | ||
| 34 | + android:layout_width="match_parent" | ||
| 35 | + android:layout_height="wrap_content" | ||
| 36 | + android:layout_above="@+id/bottomLayout" /> | ||
| 37 | + <TextView | ||
| 38 | + android:id="@+id/retryText" | ||
| 39 | + android:layout_width="match_parent" | ||
| 40 | + android:layout_height="42dp" | ||
| 41 | + android:layout_above="@+id/bottomLayout" | ||
| 42 | + android:background="@color/colorRetry" | ||
| 43 | + android:gravity="center_vertical" | ||
| 44 | + android:paddingLeft="25dp" | ||
| 45 | + android:textColor="@color/colorWhite" | ||
| 46 | + android:textSize="14dp" | ||
| 47 | + android:visibility="gone"/> | ||
| 48 | + <RelativeLayout | ||
| 49 | + android:id="@+id/bottomLayout" | ||
| 50 | + android:layout_width="match_parent" | ||
| 51 | + android:layout_height="wrap_content" | ||
| 52 | + android:layout_alignParentBottom="true"> | ||
| 53 | + | ||
| 54 | + <View | ||
| 55 | + android:id="@+id/bottomLine" | ||
| 56 | + android:layout_width="match_parent" | ||
| 57 | + android:layout_height="0.5dp" | ||
| 58 | + android:layout_marginLeft="15dp" | ||
| 59 | + android:layout_marginRight="15dp" | ||
| 60 | + android:background="#66ffffff" /> | ||
| 61 | + | ||
| 62 | + <LinearLayout | ||
| 63 | + android:layout_width="wrap_content" | ||
| 64 | + android:layout_height="wrap_content" | ||
| 65 | + android:layout_centerHorizontal="true"> | ||
| 66 | + | ||
| 67 | + <TextView | ||
| 68 | + android:id="@+id/showSoftInput" | ||
| 69 | + android:layout_width="250dp" | ||
| 70 | + android:layout_height="35dp" | ||
| 71 | + android:layout_below="@+id/bottomLine" | ||
| 72 | + android:layout_marginBottom="19dp" | ||
| 73 | + android:layout_marginRight="20dp" | ||
| 74 | + android:layout_marginTop="19dp" | ||
| 75 | + android:layout_toRightOf="@+id/playerPlayPause" | ||
| 76 | + android:background="@drawable/cnlive_chat_btn_bg" | ||
| 77 | + android:gravity="center" | ||
| 78 | + android:text="说点什么吧..." | ||
| 79 | + android:textColor="@android:color/white" | ||
| 80 | + android:textSize="14dp" /> | ||
| 81 | + | ||
| 82 | + <LinearLayout | ||
| 83 | + android:id="@+id/supportAnchor" | ||
| 84 | + android:layout_width="45dp" | ||
| 85 | + android:layout_height="45dp" | ||
| 86 | + android:layout_gravity="center_vertical" | ||
| 87 | + android:background="@drawable/cnlive_support_bg" | ||
| 88 | + android:gravity="center" | ||
| 89 | + android:orientation="vertical" | ||
| 90 | + android:visibility="visible"> | ||
| 91 | + | ||
| 92 | + <TextView | ||
| 93 | + android:layout_width="wrap_content" | ||
| 94 | + android:layout_height="wrap_content" | ||
| 95 | + android:text="¥" | ||
| 96 | + android:textColor="@android:color/white" | ||
| 97 | + android:textSize="16dp" /> | ||
| 98 | + | ||
| 99 | + <TextView | ||
| 100 | + android:layout_width="wrap_content" | ||
| 101 | + android:layout_height="wrap_content" | ||
| 102 | + android:text="支持TA" | ||
| 103 | + android:textColor="@android:color/white" | ||
| 104 | + android:textSize="9dp" /> | ||
| 105 | + | ||
| 106 | + </LinearLayout> | ||
| 107 | + | ||
| 108 | + <LinearLayout | ||
| 109 | + android:id="@+id/sendGift" | ||
| 110 | + android:layout_width="wrap_content" | ||
| 111 | + android:layout_height="wrap_content" | ||
| 112 | + android:layout_gravity="center_vertical" | ||
| 113 | + android:gravity="center" | ||
| 114 | + android:orientation="vertical" | ||
| 115 | + android:visibility="gone"> | ||
| 116 | + | ||
| 117 | + <ImageView | ||
| 118 | + android:layout_width="44dp" | ||
| 119 | + android:layout_height="34dp" | ||
| 120 | + android:src="@drawable/cnlive_flay_kiss_big" /> | ||
| 121 | + | ||
| 122 | + <TextView | ||
| 123 | + android:id="@+id/flyKissPriceText" | ||
| 124 | + android:layout_width="wrap_content" | ||
| 125 | + android:layout_height="wrap_content" | ||
| 126 | + android:layout_marginTop="5dp" | ||
| 127 | + android:textColor="@android:color/white" | ||
| 128 | + android:textSize="11dp" | ||
| 129 | + tools:text="10¥送飞吻" /> | ||
| 130 | + | ||
| 131 | + </LinearLayout> | ||
| 132 | + </LinearLayout> | ||
| 133 | + </RelativeLayout> | ||
| 134 | + | ||
| 135 | + <com.cnlive.lib_cnvideo.ui.widget.player.CNUgcInfoView | ||
| 136 | + android:id="@+id/infoView" | ||
| 137 | + android:layout_width="match_parent" | ||
| 138 | + android:layout_height="match_parent" /> | ||
| 139 | + | ||
| 140 | + <com.cnlive.lib_cnvideo.ui.widget.player.CNLiveEndView | ||
| 141 | + android:id="@+id/liveEndView" | ||
| 142 | + android:layout_width="match_parent" | ||
| 143 | + android:layout_height="match_parent" /> | ||
| 144 | + | ||
| 145 | + <include layout="@layout/cnlive_layout_player_top" /> | ||
| 146 | + | ||
| 147 | + <ImageView | ||
| 148 | + android:id="@+id/pageBack" | ||
| 149 | + android:layout_width="48dp" | ||
| 150 | + android:layout_height="48dp" | ||
| 151 | + android:padding="15dp" | ||
| 152 | + android:scaleType="fitCenter" | ||
| 153 | + android:src="@drawable/cnlive_video_back" /> | ||
| 154 | + | ||
| 155 | + <RelativeLayout | ||
| 156 | + android:id="@+id/foregroundLayout" | ||
| 157 | + android:layout_width="match_parent" | ||
| 158 | + android:layout_height="match_parent" /> | ||
| 159 | + | ||
| 160 | +</RelativeLayout> |
app/src/main/res/layout/cnlive_fragment_ugc_playback_player.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_fragment_ugc_playback_player.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:layout_width="match_parent" | ||
| 4 | + android:layout_height="match_parent" | ||
| 5 | + android:orientation="vertical"> | ||
| 6 | + | ||
| 7 | + <com.cnlive.lib_cnvideo.ui.widget.player.CNMediaPlayer | ||
| 8 | + android:id="@+id/cnlivePlayer" | ||
| 9 | + android:layout_width="match_parent" | ||
| 10 | + android:layout_height="match_parent" /> | ||
| 11 | + | ||
| 12 | + <View | ||
| 13 | + android:layout_width="match_parent" | ||
| 14 | + android:layout_height="159dp" | ||
| 15 | + android:background="@drawable/cnlive_video_top_bg"/> | ||
| 16 | + | ||
| 17 | + <include layout="@layout/cnlive_layout_player_anchor_info"/> | ||
| 18 | + | ||
| 19 | + <com.cnlive.lib_cnvideo.ui.widget.player.CNUgcInfoView | ||
| 20 | + android:id="@+id/infoView" | ||
| 21 | + android:layout_width="match_parent" | ||
| 22 | + android:layout_height="match_parent"/> | ||
| 23 | + | ||
| 24 | + <include layout="@layout/cnlive_layout_player_top"/> | ||
| 25 | + | ||
| 26 | + <ImageView | ||
| 27 | + android:id="@+id/pageBack" | ||
| 28 | + android:layout_width="48dp" | ||
| 29 | + android:layout_height="48dp" | ||
| 30 | + android:padding="15dp" | ||
| 31 | + android:scaleType="fitCenter" | ||
| 32 | + android:src="@drawable/cnlive_video_back" /> | ||
| 33 | + | ||
| 34 | +</RelativeLayout> |
app/src/main/res/layout/cnlive_item_anchor_focus.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_item_anchor_focus.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 4 | + android:id="@+id/focusLayout" | ||
| 5 | + android:layout_width="wrap_content" | ||
| 6 | + android:layout_height="45dp" | ||
| 7 | + android:orientation="vertical" | ||
| 8 | + android:gravity="center" | ||
| 9 | + android:paddingLeft="8dp"> | ||
| 10 | + | ||
| 11 | + <ImageView | ||
| 12 | + android:id="@+id/focusAvatar" | ||
| 13 | + android:layout_width="25dp" | ||
| 14 | + android:layout_height="25dp" | ||
| 15 | + android:src="@drawable/cnlive_avatar2" | ||
| 16 | + android:scaleType="fitXY"/> | ||
| 17 | + | ||
| 18 | + <TextView | ||
| 19 | + android:id="@+id/ticketCount" | ||
| 20 | + android:layout_width="wrap_content" | ||
| 21 | + android:layout_height="wrap_content" | ||
| 22 | + tools:text="100张" | ||
| 23 | + android:textSize="11dp" | ||
| 24 | + android:layout_marginTop="4dp" | ||
| 25 | + android:textColor="@android:color/white"/> | ||
| 26 | + | ||
| 27 | +</LinearLayout> | ||
| 0 | \ No newline at end of file | 28 | \ No newline at end of file |
app/src/main/res/layout/cnlive_item_chat_message.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_item_chat_message.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<com.cnlive.lib_cnvideo.ui.widget.ChatItemMessageView xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:id="@+id/chat_message_view" | ||
| 4 | + android:layout_width="wrap_content" | ||
| 5 | + android:layout_height="wrap_content"/> |
app/src/main/res/layout/cnlive_layout_controller.xml
0 → 100644
| 1 | +++ a/app/src/main/res/layout/cnlive_layout_controller.xml | ||
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="match_parent"> | ||
| 6 | + | ||
| 7 | + <RelativeLayout | ||
| 8 | + android:id="@+id/controller_top_layout" | ||
| 9 | + android:layout_width="match_parent" | ||
| 10 | + android:layout_height="58dp" | ||
| 11 | + android:background="@drawable/cnlive_video_top_bg"> | ||
| 12 | + | ||
| 13 | + <ImageView | ||
| 14 | + android:id="@+id/playShare" | ||
| 15 | + android:layout_width="40dp" | ||
| 16 | + android:layout_height="40dp" | ||
| 17 | + android:layout_alignParentRight="true" | ||
| 18 | + android:layout_marginRight="3dp" | ||
| 19 | + android:scaleType="fitCenter" | ||
| 20 | + android:padding="11dp" | ||
| 21 | + android:src="@drawable/cnlive_video_share" /> | ||
| 22 | + | ||
| 23 | + </RelativeLayout> | ||
| 24 | + | ||
| 25 | + <RelativeLayout | ||
| 26 | + android:id="@+id/controller_bottom_layout" | ||
| 27 | + android:layout_width="match_parent" | ||
| 28 | + android:layout_height="58dp" | ||
| 29 | + android:layout_alignParentBottom="true" | ||
| 30 | + android:background="@drawable/cnlive_video_bottom_bg"> | ||
| 31 | + | ||
| 32 | + <LinearLayout | ||
| 33 | + android:layout_width="wrap_content" | ||
| 34 | + android:layout_height="wrap_content" | ||
| 35 | + android:layout_alignParentBottom="true" | ||
| 36 | + android:gravity="center" | ||
| 37 | + android:layout_marginBottom="11dp"> | ||
| 38 | + | ||
| 39 | + <ImageView | ||
| 40 | + android:id="@+id/avatar" | ||
| 41 | + android:layout_width="11dp" | ||
| 42 | + android:layout_height="13dp" | ||
| 43 | + android:layout_marginLeft="15dp" | ||
| 44 | + android:layout_marginRight="4dp" | ||
| 45 | + android:src="@drawable/cnlive_avatar" /> | ||
| 46 | + | ||
| 47 | + <TextView | ||
| 48 | + android:id="@+id/liveFocusCount" | ||
| 49 | + android:layout_width="wrap_content" | ||
| 50 | + android:layout_height="wrap_content" | ||
| 51 | + android:text="0" | ||
| 52 | + android:textColor="@android:color/white" | ||
| 53 | + android:textSize="16dp" /> | ||
| 54 | + </LinearLayout> | ||
| 55 | + | ||
| 56 | + <TextView | ||
| 57 | + android:id="@+id/inputBtn" | ||
| 58 | + android:layout_width="345dp" | ||
| 59 | + android:layout_height="35dp" | ||
| 60 | + android:layout_alignParentBottom="true" | ||
| 61 | + android:layout_centerInParent="true" | ||
| 62 | + android:layout_marginBottom="4dp" | ||
| 63 | + android:background="@drawable/cnlive_chat_btn_bg" | ||
| 64 | + android:gravity="center" | ||
| 65 | + android:text="说点什么..." | ||
| 66 | + android:textColor="@android:color/white" | ||
| 67 | + android:textSize="14dp" | ||
| 68 | + android:visibility="gone" /> | ||
| 69 | + | ||
| 70 | + <ToggleButton | ||
| 71 | + android:id="@+id/barrageBtn" | ||
| 72 | + android:layout_width="37dp" | ||
| 73 | + android:layout_height="19dp" | ||
| 74 | + android:layout_alignParentBottom="true" | ||
| 75 | + android:layout_marginBottom="11dp" | ||
| 76 | + android:layout_marginRight="19dp" | ||
| 77 | + android:layout_toLeftOf="@+id/fullScreen" | ||
| 78 | + android:background="@drawable/cnlive_switch_bg" | ||
| 79 | + android:checked="true" | ||
| 80 | + android:text="" | ||
| 81 | + android:textOff="" | ||
| 82 | + android:textOn="" /> | ||
| 83 | + | ||
| 84 | + <ImageView | ||
| 85 | + android:id="@+id/fullScreen" | ||
| 86 | + android:layout_width="40dp" | ||
| 87 | + android:layout_height="40dp" | ||
| 88 | + android:layout_alignParentBottom="true" | ||
| 89 | + android:layout_alignParentRight="true" | ||
| 90 | + android:layout_marginRight="4dp" | ||
| 91 | + android:padding="11dp" | ||
| 92 | + android:scaleType="fitCenter" | ||
| 93 | + android:src="@drawable/cnlive_fullscreen_p" /> | ||
| 94 | + | ||
| 95 | + </RelativeLayout> | ||
| 96 | + | ||
| 97 | +</RelativeLayout> | ||
| 0 | \ No newline at end of file | 98 | \ No newline at end of file |