Explorar o código

commit by xulin
2019/3/20

lyn %!s(int64=6) %!d(string=hai) anos
pai
achega
a95040db75
Modificáronse 60 ficheiros con 477 adicións e 990 borrados
  1. 29 0
      .idea/codeStyles/Project.xml
  2. 1 0
      .idea/gradle.xml
  3. 10 5
      .idea/misc.xml
  4. 2 1
      .idea/modules.xml
  5. 1 1
      .idea/vcs.xml
  6. 4 5
      app/build.gradle
  7. BIN=BIN
      app/release/dudutoy.apk
  8. 1 1
      app/release/output.json
  9. 4 9
      app/src/main/AndroidManifest.xml
  10. 0 493
      app/src/main/java/com/haochuan/dudutoy/DuduPlayer.java
  11. 3 3
      app/src/main/java/com/haochuan/dudutoy/HuaweiPay.java
  12. 272 61
      app/src/main/java/com/haochuan/dudutoy/MainActivity.java
  13. 4 1
      app/src/main/java/com/haochuan/dudutoy/PayActivity.java
  14. 0 43
      app/src/main/java/com/haochuan/dudutoy/TestUnsubscribe.java
  15. 10 0
      app/src/main/java/com/haochuan/dudutoy/UrlManager.java
  16. 7 3
      app/src/main/java/com/haochuan/dudutoy/VideoEndDialog.java
  17. 26 0
      app/src/main/java/com/haochuan/dudutoy/VideoInfo.java
  18. 95 52
      app/src/main/java/com/haochuan/dudutoy/VideoPlayerActivity.java
  19. BIN=BIN
      app/src/main/res/drawable-hdpi/btn_icon_right.png
  20. BIN=BIN
      app/src/main/res/drawable-hdpi/btn_icon_stop.png
  21. BIN=BIN
      app/src/main/res/drawable-hdpi/loading_1.png
  22. BIN=BIN
      app/src/main/res/drawable-hdpi/loading_2.png
  23. BIN=BIN
      app/src/main/res/drawable-hdpi/logo_icon_down.png
  24. BIN=BIN
      app/src/main/res/drawable-hdpi/logo_icon_left.png
  25. BIN=BIN
      app/src/main/res/drawable-hdpi/logo_icon_ok.png
  26. BIN=BIN
      app/src/main/res/drawable-hdpi/logo_icon_right.png
  27. BIN=BIN
      app/src/main/res/drawable-ldpi/loading_1.png
  28. BIN=BIN
      app/src/main/res/drawable-ldpi/loading_2.png
  29. BIN=BIN
      app/src/main/res/drawable-ldpi/logo_icon_down.png
  30. BIN=BIN
      app/src/main/res/drawable-ldpi/logo_icon_left.png
  31. BIN=BIN
      app/src/main/res/drawable-ldpi/logo_icon_ok.png
  32. BIN=BIN
      app/src/main/res/drawable-ldpi/logo_icon_right.png
  33. BIN=BIN
      app/src/main/res/drawable-mdpi/loading_1.png
  34. BIN=BIN
      app/src/main/res/drawable-mdpi/loading_2.png
  35. BIN=BIN
      app/src/main/res/drawable-mdpi/logo_icon_down.png
  36. BIN=BIN
      app/src/main/res/drawable-mdpi/logo_icon_left.png
  37. BIN=BIN
      app/src/main/res/drawable-mdpi/logo_icon_ok.png
  38. BIN=BIN
      app/src/main/res/drawable-mdpi/logo_icon_right.png
  39. BIN=BIN
      app/src/main/res/drawable-xhdpi/loading_1.png
  40. BIN=BIN
      app/src/main/res/drawable-xhdpi/loading_2.png
  41. BIN=BIN
      app/src/main/res/drawable-xhdpi/logo_icon_down.png
  42. BIN=BIN
      app/src/main/res/drawable-xhdpi/logo_icon_left.png
  43. BIN=BIN
      app/src/main/res/drawable-xhdpi/logo_icon_ok.png
  44. BIN=BIN
      app/src/main/res/drawable-xhdpi/logo_icon_right.png
  45. BIN=BIN
      app/src/main/res/drawable-xxhdpi/loading_1.png
  46. BIN=BIN
      app/src/main/res/drawable-xxhdpi/loading_2.png
  47. BIN=BIN
      app/src/main/res/drawable-xxhdpi/logo_icon_down.png
  48. BIN=BIN
      app/src/main/res/drawable-xxhdpi/logo_icon_left.png
  49. BIN=BIN
      app/src/main/res/drawable-xxhdpi/logo_icon_ok.png
  50. BIN=BIN
      app/src/main/res/drawable-xxhdpi/logo_icon_right.png
  51. 4 2
      app/src/main/res/layout/activity_video_player.xml
  52. 1 0
      app/src/main/res/layout/dialog_video_end.xml
  53. 0 297
      app/src/main/res/layout/du_du_player.xml
  54. 0 5
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  55. 0 5
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  56. 1 1
      app/src/main/res/values/strings.xml
  57. BIN=BIN
      release/app-release.apk
  58. BIN=BIN
      release/dudutoy.apk
  59. 1 1
      release/output.json
  60. 1 1
      settings.gradle

+ 29 - 0
.idea/codeStyles/Project.xml

@@ -0,0 +1,29 @@
+<component name="ProjectCodeStyleConfiguration">
+  <code_scheme name="Project" version="173">
+    <Objective-C-extensions>
+      <file>
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
+      </file>
+      <class>
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
+      </class>
+      <extensions>
+        <pair source="cpp" header="h" fileNamingConvention="NONE" />
+        <pair source="c" header="h" fileNamingConvention="NONE" />
+      </extensions>
+    </Objective-C-extensions>
+  </code_scheme>
+</component>

+ 1 - 0
.idea/gradle.xml

@@ -10,6 +10,7 @@
             <option value="$PROJECT_DIR$" />
             <option value="$PROJECT_DIR$/TvSDK_Lib_Project" />
             <option value="$PROJECT_DIR$/app" />
+            <option value="$PROJECT_DIR$/bdvideoplayer" />
           </set>
         </option>
         <option name="resolveModulePerSourceSet" value="false" />

+ 10 - 5
.idea/misc.xml

@@ -5,26 +5,31 @@
     <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
     <option name="myNullables">
       <value>
-        <list size="4">
+        <list size="7">
           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
-          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
-          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+          <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
+          <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
+          <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+          <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
+          <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
         </list>
       </value>
     </option>
     <option name="myNotNulls">
       <value>
-        <list size="4">
+        <list size="6">
           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
           <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
           <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
+          <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
+          <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
         </list>
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 2 - 1
.idea/modules.xml

@@ -2,9 +2,10 @@
 <project version="4">
   <component name="ProjectModuleManager">
     <modules>
-      <module fileurl="file://$PROJECT_DIR$/DuduToy.iml" filepath="$PROJECT_DIR$/DuduToy.iml" />
+      <module fileurl="file://$PROJECT_DIR$/DuduToy_tianjin.iml" filepath="$PROJECT_DIR$/DuduToy_tianjin.iml" />
       <module fileurl="file://$PROJECT_DIR$/TvSDK_Lib_Project/TvSDK_Lib_Project.iml" filepath="$PROJECT_DIR$/TvSDK_Lib_Project/TvSDK_Lib_Project.iml" />
       <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
+      <module fileurl="file://$PROJECT_DIR$/bdvideoplayer/bdvideoplayer.iml" filepath="$PROJECT_DIR$/bdvideoplayer/bdvideoplayer.iml" />
     </modules>
   </component>
 </project>

+ 1 - 1
.idea/vcs.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="VcsDirectoryMappings">
-    <mapping directory="$PROJECT_DIR$/git" vcs="Git" />
+    <mapping directory="" vcs="Git" />
   </component>
 </project>

+ 4 - 5
app/build.gradle

@@ -5,7 +5,7 @@ android {
         config {
             keyAlias 'haochuan'
             keyPassword '123456'
-            storeFile file('D:/android project/DuduToy/key/dudutoykey.jks')
+            storeFile file('D:/android project/tianjin/DuduToy_tianjin/key/dudutoykey.jks')
             storePassword '123456'
         }
     }
@@ -15,8 +15,8 @@ android {
         applicationId "com.haochuan.dudutoy"
         minSdkVersion 15
         targetSdkVersion 27
-        versionCode 1
-        versionName "1.0.1"
+        versionCode 7
+        versionName "1.0.7"
         ndk {
             abiFilters "armeabi-v7a", "x86"
         }
@@ -40,11 +40,10 @@ android {
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
     implementation project(':TvSDK_Lib_Project')
+    implementation project(':bdvideoplayer')
     implementation 'com.android.support:appcompat-v7:27.0.2'
     implementation 'com.android.support:support-v4:27.0.2'
     implementation 'com.android.support.constraint:constraint-layout:1.0.2'
-    implementation 'com.shuyu:gsyVideoPlayer-java:5.0.0-beta'
-    implementation 'com.shuyu:gsyVideoPlayer-ex_so:5.0.0-beta'
     implementation 'com.android.volley:volley:1.1.0'
     implementation 'com.squareup.retrofit2:retrofit:2.3.0'
     implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

BIN=BIN
app/release/dudutoy.apk


+ 1 - 1
app/release/output.json

@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.haochuan.dudutoy","split":"","minSdkVersion":"16"}}]
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":7},"path":"app-release.apk","properties":{"packageId":"com.haochuan.dudutoy","split":"","minSdkVersion":"15"}}]

+ 4 - 9
app/src/main/AndroidManifest.xml

@@ -13,21 +13,20 @@
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <uses-permission android:name="android.permission.RECEIVE_SMS" />
     <uses-permission android:name="android.permission.WAKE_LOCK" />
+    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
 
     <application
         android:name=".ToyApplication"
         android:allowBackup="true"
-        android:icon="@drawable/dudu_icon"
+        android:icon="@mipmap/ic_launcher_app"
         android:label="@string/app_name"
         android:roundIcon="@mipmap/ic_launcher_round"
         android:screenOrientation="landscape"
-        android:supportsRtl="true"
+        android:hardwareAccelerated="true"
         android:theme="@style/AppTheme">
         <activity
             android:name=".MainActivity"
-            android:hardwareAccelerated="true"
-            android:launchMode="singleTop"
-            android:process=":remote"
+            android:hardwareAccelerated="false"
             android:screenOrientation="landscape">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -37,10 +36,6 @@
         </activity>
         <activity
             android:name=".VideoPlayerActivity"
-            android:hardwareAccelerated="true"
-            android:screenOrientation="landscape"></activity>
-        <activity
-            android:name=".TestUnsubscribe"
             android:screenOrientation="landscape"></activity>
 
         <!-- 计费开始 -->

+ 0 - 493
app/src/main/java/com/haochuan/dudutoy/DuduPlayer.java

@@ -1,493 +0,0 @@
-package com.haochuan.dudutoy;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.drawable.AnimationDrawable;
-import android.os.Handler;
-import android.os.Looper;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.SeekBar;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.shuyu.gsyvideoplayer.GSYVideoManager;
-import com.shuyu.gsyvideoplayer.model.VideoOptionModel;
-import com.shuyu.gsyvideoplayer.utils.Debuger;
-import com.shuyu.gsyvideoplayer.utils.GSYVideoType;
-import com.shuyu.gsyvideoplayer.video.GSYADVideoPlayer;
-import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import moe.codeest.enviews.ENDownloadView;
-import tv.danmaku.ijk.media.player.IjkMediaPlayer;
-
-
-/**
- * Created by Lyn on 2018/5/30.
- */
-
-public class DuduPlayer extends StandardGSYVideoPlayer {
-
-    ImageView startBtn;
-    ImageView loading;
-    AnimationDrawable a;
-    OnCompleteListener onCompleteListener;
-
-    LinearLayout seekContainer;
-    SeekBar seekBar;
-    TextView durationText;
-    TextView percentText;
-
-    private long currentTime = 0;
-
-    Context context;
-    Timer timer ;
-    TimerTask timerTask;
-
-    private boolean isSeeked = false;
-
-    private boolean isNoticed = false;
-
-    String TAG = "DuduPlayer";
-
-
-
-
-    public DuduPlayer(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public void setOnCompleteListener(OnCompleteListener onCompleteListener){
-        this.onCompleteListener = onCompleteListener;
-    }
-
-    @Override
-    protected void init(Context context) {
-        super.init(context);
-        this.context = context;
-        mDismissControlTime = 200;
-        startBtn = findViewById(R.id.dudu_start_btn);
-        loading = findViewById(R.id.loading_anim);
-        seekContainer = findViewById(R.id.seek_container);
-        durationText = findViewById(R.id.duration_text);
-        percentText = findViewById(R.id.percent_text);
-        seekBar = findViewById(R.id.seek_bar);
-        seekBar.setMax(1000);
-        seekBar.setProgress(0);
-        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
-            @Override
-            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
-                int mProgress = 0;
-                if (fromUser) {
-                    mProgress = progress;
-                }
-                percentText.setText(mProgress/10 + "%");
-
-                if(progress<=0){
-                    seekBar.setProgress(10);
-                    percentText.setText("1%");
-                }
-
-                if(progress >= 1000){
-                    seekBar.setProgress(990);
-                    percentText.setText("99%");
-                }
-            }
-
-            @Override
-            public void onStartTrackingTouch(SeekBar seekBar) {
-
-            }
-
-            @Override
-            public void onStopTrackingTouch(SeekBar seekBar) {
-
-            }
-        });
-        //GSYVideoType.enableMediaCodec();
-        //GSYVideoType.enableMediaCodecTexture();
-        videoOptimize();
-        initLoadingAnimation();
-        initTimer();
-        Debuger.disable();
-    }
-
-
-
-    private void videoOptimize(){
-        List<VideoOptionModel> list = new ArrayList<>();
-        VideoOptionModel videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "allowed_media_types", "video"); //根据媒体类型来配置
-        list.add(videoOptionModel);
-        videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "mediacodec", 1);
-        list.add(videoOptionModel);
-        videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "videotoolbox", 0);
-        list.add(videoOptionModel);
-        videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "timeout", 20000);
-        list.add(videoOptionModel);
-        videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "buffer_size", 1316);
-        list.add(videoOptionModel);
-        videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "infbuf", 1);  // 无限读
-        list.add(videoOptionModel);
-        videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "analyzemaxduration", 100);
-        list.add(videoOptionModel);
-        videoOptionModel = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "flush_packets", 1);
-        list.add(videoOptionModel);
-        GSYVideoManager.instance().setOptionModelList(list);
-    }
-
-    private void initLoadingAnimation(){
-        loading.setImageResource(R.drawable.loading_animation);
-        AnimationDrawable a = (AnimationDrawable)loading.getDrawable();
-        a.start();
-    }
-
-    @Override
-    public void clickStartIcon(){
-        super.clickStartIcon();
-    }
-
-    @Override
-    public int getLayoutId() {
-        return R.layout.du_du_player;
-    }
-
-
-
-    public void seek(int position){
-        if(mCurrentState == CURRENT_STATE_PREPAREING || getDuration() == 0 || mCurrentState!= CURRENT_STATE_PLAYING){
-            return;
-        }
-
-        seekContainer.setVisibility(VISIBLE);
-        seekBar.setProgress(position);
-
-        currentTime =Calendar.getInstance().getTimeInMillis();
-        cancelTimer();
-        initTimer();
-        isSeeked = true;
-    }
-
-
-    private void initTimer(){
-        if(timer == null){
-            timer = new Timer();
-        }
-        timerTask = new TimerTask() {
-            @Override
-            public void run() {
-                Activity activity = (Activity)context;
-                activity.runOnUiThread(new Runnable() {
-                    @Override
-                    public void run() {
-                        long myCurrentTime = Calendar.getInstance().getTimeInMillis();
-                        if(myCurrentTime - currentTime > 3){
-                            int position = seekBar.getProgress();
-                            position = position* getDuration()/1000;
-                            seekTo(position);
-                            seekContainer.setVisibility(INVISIBLE);
-                        }
-                    }
-                });
-            }
-        };
-
-        timer.schedule(timerTask,3000);
-    }
-
-    public boolean canSeek(){
-        if(mCurrentState == CURRENT_STATE_PREPAREING || getDuration() == 0){
-            return false;
-        }else{
-            return true;
-        }
-    }
-
-    private void cancelTimer(){
-        if(timerTask != null){
-            timerTask.cancel();
-        }
-    }
-
-    @Override
-    public void onStopTrackingTouch(SeekBar seekBar) {
-        super.onStopTrackingTouch(seekBar);
-    }
-
-    @Override
-    protected void showWifiDialog() {
-        startPlayLogic();
-    }
-
-    @Override
-    protected void changeUiToPauseShow(){
-        Debuger.printfLog("changeUiToPauseShow");
-
-        setViewShowState(mTopContainer, VISIBLE);
-        setViewShowState(mBottomContainer, VISIBLE);
-        setViewShowState(mStartButton, INVISIBLE);
-        setViewShowState(mLoadingProgressBar, INVISIBLE);
-        setViewShowState(mThumbImageViewLayout, INVISIBLE);
-        setViewShowState(mBottomProgressBar, INVISIBLE);
-        setViewShowState(mLockScreen, (mIfCurrentIsFullscreen && mNeedLockFull) ? VISIBLE : GONE);
-
-        if (mLoadingProgressBar instanceof ENDownloadView) {
-            ((ENDownloadView) mLoadingProgressBar).reset();
-        }
-        updateStartImage();
-        updatePauseCover();
-
-        //Log.d(TAG,"changeUiToPauseShow");
-    }
-
-    public  String convertLongTimeToStr(long time) {
-        int ss = 1000;
-        int mi = ss * 60;
-        int hh = mi * 60;
-
-        long hour = (time) / hh;
-        long minute = (time - hour * hh) / mi;
-        long second = (time - hour * hh - minute * mi) / ss;
-
-        String strHour = hour < 10 ? "0" + hour : "" + hour;
-        String strMinute = minute < 10 ? "0" + minute : "" + minute;
-        String strSecond = second < 10 ? "0" + second : "" + second;
-        if (hour > 0) {
-            return strHour + ":" + strMinute + ":" + strSecond;
-        } else {
-            return strMinute + ":" + strSecond;
-        }
-    }
-
-    @Override
-    protected void changeUiToPlayingShow() {
-        Debuger.printfLog("changeUiToPlayingShow");
-        isBuffering = false;
-        setViewShowState(mTopContainer, INVISIBLE);
-        setViewShowState(mBottomContainer, INVISIBLE);
-        setViewShowState(mStartButton, INVISIBLE);
-        setViewShowState(mLoadingProgressBar, INVISIBLE);
-        setViewShowState(mThumbImageViewLayout, INVISIBLE);
-        setViewShowState(mBottomProgressBar, INVISIBLE);
-        setViewShowState(mLockScreen, (mIfCurrentIsFullscreen && mNeedLockFull) ? VISIBLE : GONE);
-        durationText.setText(convertLongTimeToStr(getDuration()));
-        if (mLoadingProgressBar instanceof ENDownloadView) {
-            ((ENDownloadView) mLoadingProgressBar).reset();
-        }
-        updateStartImage();
-        //Log.d(TAG,"changeUiToPreparingShow");
-    }
-
-    @Override
-    protected void changeUiToNormal() {
-        Debuger.printfLog("changeUiToNormal");
-
-        setViewShowState(mTopContainer, VISIBLE);
-        setViewShowState(mBottomContainer, VISIBLE);
-        setViewShowState(mStartButton, INVISIBLE);
-        setViewShowState(mLoadingProgressBar, INVISIBLE);
-        setViewShowState(mThumbImageViewLayout, VISIBLE);
-        setViewShowState(mBottomProgressBar, INVISIBLE);
-        setViewShowState(mLockScreen, (mIfCurrentIsFullscreen && mNeedLockFull) ? VISIBLE : GONE);
-
-        updateStartImage();
-        if (mLoadingProgressBar instanceof ENDownloadView) {
-            ((ENDownloadView) mLoadingProgressBar).reset();
-        }
-
-        //Log.d(TAG,"changeUiToNormal");
-    }
-
-
-    @Override
-    protected void changeUiToCompleteShow() {
-        Debuger.printfLog("changeUiToCompleteShow");
-
-        setViewShowState(mTopContainer, VISIBLE);
-        setViewShowState(mBottomContainer, VISIBLE);
-        setViewShowState(mStartButton, INVISIBLE);
-        setViewShowState(mLoadingProgressBar, INVISIBLE);
-        setViewShowState(mThumbImageViewLayout, VISIBLE);
-        setViewShowState(mBottomProgressBar, INVISIBLE);
-        setViewShowState(mLockScreen, (mIfCurrentIsFullscreen && mNeedLockFull) ? VISIBLE : GONE);
-
-        this.onCompleteListener.onComplete();
-        if (mLoadingProgressBar instanceof ENDownloadView) {
-            ((ENDownloadView) mLoadingProgressBar).reset();
-        }
-        updateStartImage();
-        //Log.d(TAG,"changeUiToCompleteShow");
-    }
-
-    private void Toast(final String msg){
-        Activity activity = (Activity)context;
-        activity.runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                Toast.makeText(context,msg,Toast.LENGTH_SHORT).show();
-            }
-        });
-    }
-
-    @Override
-    public void onError(int what, int extra) {
-        if(what == -10000){
-            return;
-        }
-        super.onError(what,extra);
-        Log.d(TAG,"what:" + what + "extra:" + extra);
-    }
-
-
-
-    @Override
-    protected void changeUiToError() {
-        Debuger.printfLog("changeUiToError");
-
-        setViewShowState(mTopContainer, VISIBLE);
-        setViewShowState(mBottomContainer, VISIBLE);
-        setViewShowState(mStartButton, INVISIBLE);
-        setViewShowState(mLoadingProgressBar, INVISIBLE);
-        setViewShowState(mThumbImageViewLayout, INVISIBLE);
-        setViewShowState(mBottomProgressBar, INVISIBLE);
-        setViewShowState(mLockScreen, (mIfCurrentIsFullscreen && mNeedLockFull) ? VISIBLE : GONE);
-
-        if (mLoadingProgressBar instanceof ENDownloadView) {
-            ((ENDownloadView) mLoadingProgressBar).reset();
-        }
-        updateStartImage();
-        //Log.d(TAG,"changeUiToError");
-        Toast("播放器发生错误,请退出播放!");
-        onCompleteListener.onComplete();
-    }
-
-    long lastBufferingTime = 0;
-
-    boolean isBuffering = false;
-    @Override
-    protected void changeUiToPlayingBufferingShow() {
-        Date date = new Date();
-        long currentBufferingTime = date.getTime();
-        Debuger.printfLog("changeUiToPlayingBufferingShow,lastBufferingTime" + currentBufferingTime);
-        if(currentBufferingTime - lastBufferingTime > 1500){
-            setViewShowState(mTopContainer, INVISIBLE);
-            setViewShowState(mBottomContainer, INVISIBLE);
-            setViewShowState(mStartButton, INVISIBLE);
-            setViewShowState(mLoadingProgressBar, VISIBLE);
-            setViewShowState(mThumbImageViewLayout, INVISIBLE);
-            setViewShowState(mBottomProgressBar, INVISIBLE);
-            setViewShowState(mLockScreen, GONE);
-
-            if (mLoadingProgressBar instanceof ENDownloadView) {
-                ENDownloadView enDownloadView = (ENDownloadView) mLoadingProgressBar;
-                if (enDownloadView.getCurrentState() == ENDownloadView.STATE_PRE) {
-                    ((ENDownloadView) mLoadingProgressBar).start();
-                }
-            }
-        }
-        isSeeked = false;
-        lastBufferingTime =currentBufferingTime;
-        isBuffering = true;
-        if(!isNoticed){
-            Toast("提示!视频在缓冲过程中,请不要做其他任何操作,以免发生异常!");
-            isNoticed = true;
-        }
-
-       // Log.d(TAG,"changeUiToPlayingBufferingShow,");
-    }
-
-    @Override
-    protected void changeUiToPreparingShow() {
-        super.changeUiToPreparingShow();
-       // Log.d(TAG,"changeUiToPreparingShow");
-    }
-
-
-    public void playOrPause(){
-        if (mCurrentState == CURRENT_STATE_PLAYING) {
-            try {
-                getGSYVideoManager().pause();
-                setStateAndUi(CURRENT_STATE_PAUSE);
-                startBtn.setImageResource(R.drawable.btn_icon_right);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }else if (mCurrentState == CURRENT_STATE_PAUSE){
-            try {
-                getGSYVideoManager().start();
-                setStateAndUi(CURRENT_STATE_PLAYING);
-                startBtn.setImageResource(R.drawable.btn_icon_stop);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    public void play(){
-        if (mCurrentState == CURRENT_STATE_PAUSE){
-            try {
-                getGSYVideoManager().start();
-                setStateAndUi(CURRENT_STATE_PLAYING);
-                startBtn.setImageResource(R.drawable.btn_icon_stop);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    public void pause(){
-        if (mCurrentState == CURRENT_STATE_PLAYING || mCurrentState == CURRENT_STATE_PLAYING_BUFFERING_START) {
-            try {
-                getGSYVideoManager().pause();
-                setStateAndUi(CURRENT_STATE_PAUSE);
-                startBtn.setImageResource(R.drawable.btn_icon_right);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    public void onDestroy(){
-        startBtn = null;
-        loading = null;
-        if(a != null){
-            a.stop();
-        }
-        a = null;
-        onCompleteListener = null;
-        seekContainer = null;
-        seekBar = null;
-        durationText = null;
-        percentText= null;
-        context = null;
-        if(timer !=null){
-            timer.cancel();
-        }
-        if(timerTask !=null){
-            timerTask.cancel();
-        }
-        timer = null;
-        timerTask = null;
-
-    }
-
-    public boolean isBuffering(){
-        return isBuffering;
-    }
-
-    public interface OnCompleteListener{
-        public void onComplete();
-    }
-
-
-
-}

+ 3 - 3
app/src/main/java/com/haochuan/dudutoy/HuaweiPay.java

@@ -28,9 +28,9 @@ import java.util.UUID;
 
 public class HuaweiPay {
     private String appKey="hcjf";
-    private String appId="hcddwjwg";
-    private String authProductId="ddwjwgby";
-    private String authContentId="ddwjwgby";
+    private String appId="hcddyxwg";
+    private String authProductId="ddyxwgby025";
+    private String authContentId="ddyxwgby025";
     private String productId="1";
     private String thirdAppId="1";
     private String thirdAppName="嘟嘟玩具王国";

+ 272 - 61
app/src/main/java/com/haochuan/dudutoy/MainActivity.java

@@ -1,6 +1,7 @@
 package com.haochuan.dudutoy;
 
 import android.app.Activity;
+import android.app.ActivityManager;
 import android.app.AlertDialog;
 import android.app.ProgressDialog;
 import android.content.DialogInterface;
@@ -9,6 +10,7 @@ import android.graphics.drawable.AnimationDrawable;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
+import android.support.v4.content.ContextCompat;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.View;
@@ -40,6 +42,8 @@ import com.sdk.commplatform.listener.CallbackListener;
 
 import org.json.JSONObject;
 
+import java.util.List;
+
 public class MainActivity extends Activity {
 
     String TAG = "HuaweiPay";
@@ -53,6 +57,9 @@ public class MainActivity extends Activity {
 
     boolean enableLogger = false;
 
+    String intentUrl = "";
+    boolean hasIntentUrl = false;
+
     private void Logger(String msg){
         if(enableLogger){
             Log.d(TAG,msg);
@@ -67,12 +74,14 @@ public class MainActivity extends Activity {
 
     private H5Result h5Result = new H5Result() {
         @Override
-        public void videoPlay(String url,String title,String uId,String sourceId) {
+        public void videoPlay(String url,String title,String uId,String sourceId,int vipState,int isFee) {
             Intent intent = new Intent(MainActivity.this,VideoPlayerActivity.class);
             intent.putExtra("url",url);
             intent.putExtra("title",title);
             intent.putExtra("uId",uId);
             intent.putExtra("sourceId",sourceId);
+            intent.putExtra("vipState",vipState);
+            intent.putExtra("isFee",isFee);
             MainActivity.this.startActivityForResult(intent,requestPlayCode);
         }
     };
@@ -83,7 +92,6 @@ public class MainActivity extends Activity {
             Toast("计费成功" );
             Logger("计费成功");
             authAfterPay();
-
         }
 
         @Override
@@ -100,6 +108,7 @@ public class MainActivity extends Activity {
         Logger("计费返回");
         Logger("开始鉴权");
 
+        Log.d(TAG,(isPlayPay?"当前订购页":"当前不是订购页")+ ";计费返回");
         HuaweiPay.getInstance().authForMonth(new CallbackListener<AuthResult>() {
             @Override
             public void callback(int i, AuthResult authResult) {
@@ -122,7 +131,7 @@ public class MainActivity extends Activity {
                 }else{
                     Logger("不跳转到主页");
                 }
-
+                isPlayPay = false;
             }
         });
     }
@@ -150,6 +159,7 @@ public class MainActivity extends Activity {
             @Override
             public void run() {
                 String url = transUrl(MainActivity.this.backUrl);
+                Log.d(TAG,"跳转到主页,url:"+url);
                 webview.loadUrl(url);
             }
         });
@@ -183,14 +193,31 @@ public class MainActivity extends Activity {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
+        Intent intent = getIntent();
+        if(intent != null){
+            if(intent.hasExtra("data")){
+                String jsonData = intent.getStringExtra("data");
+                try{
+                    JSONObject object = new JSONObject(jsonData);
+                    if(object.has("linkUrl")){
+                        intentUrl = object.getString("linkUrl");
+                        hasIntentUrl = true;
+                    }
+                }catch (Exception e){
+                    e.printStackTrace();
+                }
+            }
+        }
         FrameLayout frameLayout = findViewById(R.id.webview_container);
         webview = new WebView(this);
+        webview.setLayerType(View.LAYER_TYPE_SOFTWARE,null);
         frameLayout.addView(webview,new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
         webview.setVisibility(View.INVISIBLE);
         pageLoadingAnim = findViewById(R.id.loading_anim);
         initLoadingAnimation();
         prepare();
 
+
     }
 
     public void saveLoginUser(String userId){
@@ -227,10 +254,34 @@ public class MainActivity extends Activity {
 
 
     private void loadH5Url(){
-        String url = "http://202.99.114.74:56199/h5/toymallapp/index.html?is_vip=%s&uid=%s";
+        Log.d(TAG,"开始加载页面");
+        String url = "http://202.99.114.74:56199/h5/toymallapk/index.html";
         url = String.format(url,new LocalStore(MainActivity.this).getIsVip(),userId);
+        if(hasIntentUrl){
+            url = intentUrl;
+        }
         webview.getSettings().setJavaScriptEnabled(true);
         webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
+        webview.getSettings().setAppCacheEnabled(false);
+        webview.getSettings().setDomStorageEnabled(true);
+
+        // 清缓存和记录,缓存引起的白屏
+        webview.clearCache(true);
+        webview.clearHistory();
+
+        webview.requestFocus();
+        WebSettings webSettings = webview.getSettings();
+        webSettings.setDatabaseEnabled(true);
+        // 缓存白屏
+        String appCachePath = getApplicationContext().getCacheDir()
+                .getAbsolutePath() + "/webcache";
+        // 设置 Application Caches 缓存目录
+        webSettings.setAppCachePath(appCachePath);
+        webSettings.setDatabasePath(appCachePath);
+
+        webview.setBackgroundColor(ContextCompat.getColor(this,android.R.color.transparent));
+        webview.setBackgroundResource(R.color.black);
+
         webview.setWebChromeClient(new WebChromeClient() {
             @Override
             public void onProgressChanged(WebView view, int progress) {
@@ -242,6 +293,7 @@ public class MainActivity extends Activity {
             public void onPageFinished(WebView view, String url)
             {
                 super.onPageFinished(view, url);
+                Log.d(TAG,"webview加载完成");
                 stopLoadingAnimation();
                 webview.setVisibility(View.VISIBLE);
             }
@@ -256,6 +308,65 @@ public class MainActivity extends Activity {
 
     }
 
+   /* private boolean isHeNanUser(String userId){
+        String[] strs = userId.split("_");
+        if(strs.length>1){
+            return strs[1].equals("204");
+        }else{
+            return false;
+        }
+    }
+*/
+    private void checkArea(String userId,final UserCheck listener){
+        String url = new UrlManager().getCheckAreaUrl(userId);
+        Volley.newRequestQueue(this).add(new JsonObjectRequest(url, null, new Response.Listener<JSONObject>() {
+            @Override
+            public void onResponse(JSONObject response) {
+                try{
+                    if(response.has("code")){
+                        int code = response.getInt("code");
+                        if(code == 0){
+                            if(response.has("data")){
+                                JSONObject data = response.getJSONObject("data");
+                                if(data.has("order_type")){
+                                    int orderType = data.getInt("order_type");
+                                    switch (orderType){
+                                        case 10:
+                                            listener.isHuTongArea(true);
+                                            break;
+                                        case -10:
+                                            listener.isHuTongArea(false);
+                                            break;
+                                        default:
+                                            listener.isHuTongArea(false);
+                                    }
+                                }else{
+                                    listener.isHuTongArea(false);
+                                }
+                            }else{
+                                listener.isHuTongArea(false);
+                            }
+                        }else{
+                            listener.isHuTongArea(false);
+                        }
+                    }else{
+                        listener.isHuTongArea(false);
+                    }
+                }catch (Exception e){
+                    e.printStackTrace();
+                    listener.isHuTongArea(false);
+                }
+
+            }
+        }, new Response.ErrorListener() {
+            @Override
+            public void onErrorResponse(VolleyError error) {
+                listener.isHuTongArea(false);
+            }
+        }));
+    }
+
+
     private void prepare(){
         HuaweiPay.getInstance().init(this, new CallbackListener<Integer>()
         {
@@ -264,67 +375,83 @@ public class MainActivity extends Activity {
             {
                 switch (paramInt){
                     case ErrorCode.COM_PLATFORM_SUCCESS:
-                        //Toast("初始化成功");
-                        HuaweiPay.getInstance().authForMonth(new CallbackListener<AuthResult>() {
+                        Toast("初始化成功");
+                        userId = HuaweiPay.getInstance().getUserId();
+                        Log.d(TAG,"获取userId:" + userId);
+                        Toast("获取userId:" + userId);
+                        //saveLoginUser(userId);
+                        //判断该地区需不需要订购互通
+                        Auth();
+                       /* checkArea(userId, new UserCheck() {
                             @Override
-                            public void callback(int i, AuthResult authResult) {
-                                switch (i){
-                                    case ErrorCode.COM_PLATFORM_SUCCESS:
-                                        new LocalStore(MainActivity.this).saveIsVip(true);
-                                        if(authResult!=null){
-                                            Toast(authResult.description);
-                                            Log.i(TAG,authResult.description);
+                            public void isHuTongArea(Boolean result) {
+                                if(result){
+                                    //判断linux平台是不是会员
+                                    Log.d(TAG,"该地区需要订购互通");
+                                    String url = new UrlManager().getHeNanVipStateUrl(userId);
+                                    Volley.newRequestQueue(MainActivity.this).add(new JsonObjectRequest(url, null, new Response.Listener<JSONObject>() {
+                                        @Override
+                                        public void onResponse(JSONObject response) {
+                                            if(response.has("data")){
+                                                try{
+                                                    int data = response.getInt("data");
+                                                    switch(data){
+                                                        case 1:
+                                                            Log.d(TAG,"是linux会员");
+                                                            new LocalStore(MainActivity.this).saveIsVip(true);
+                                                            runH5();
+                                                            break;
+                                                        case -1:
+                                                            Log.d(TAG,"不是linux会员");
+                                                            Auth();
+                                                            break;
+                                                        default:
+                                                            Log.d(TAG,"其他");
+                                                            Auth();
+                                                            break;
+                                                    }
+                                                }catch (Exception e){
+                                                    e.printStackTrace();
+                                                    Auth();
+                                                }
+                                            }
                                         }
-                                        runH5();
-                                        break;
-                                    case ErrorCode.COM_PLATFORM_ERROR_PARAM:
-                                        new LocalStore(MainActivity.this).saveIsVip(false);
-                                        if(authResult!=null){
-                                            getBuyProductId(authResult);
+                                    }, new Response.ErrorListener() {
+                                        @Override
+                                        public void onErrorResponse(VolleyError error) {
+                                            error.printStackTrace();
+                                            Auth();
                                         }
-                                        runH5();
-                                        Log.i(TAG,"参数错误,errorcode:" + paramInt);
-                                        break;
-                                    case ErrorCode.COM_PLATFORM_ERROR_UNKNOWN:
-                                        new LocalStore(MainActivity.this).saveIsVip(false);
-                                        if(authResult!=null){
-                                            getBuyProductId(authResult);
-                                        }
-                                        runH5();
-                                        Log.i(TAG,"SDK未初始化及其它错误,errorcode:" + paramInt);
-                                        break;
-                                    default:
-                                        new LocalStore(MainActivity.this).saveIsVip(false);
-                                        if(authResult!=null){
-                                            getBuyProductId(authResult);
-                                        }
-                                        runH5();
-                                        Log.i(TAG,"其他错误,errorcode:" + paramInt);
-                                        break;
+                                    }));
+                                }else{
+                                    Auth();
                                 }
                             }
-                        });
-                        userId = HuaweiPay.getInstance().getUserId();
-                        saveLoginUser(userId);
+                        });*/
+
                         break;
                     case ErrorCode.COM_PLATFORM_ERROR_ONLINE_CHECK_FAILURE:
                         Log.i(TAG,"无网络");
                         CrashHandler.getInstance().saveCrashInfoToWeb("初始化失败,无网络");
+                        Toast("初始化失败:无网络" );
                         onInitFail();
                         break;
                     case ErrorCode.COM_PLATFORM_ERROR_FORCE_CLOSE:
                         Log.i(TAG,"初始化异常,强制退出");
                         CrashHandler.getInstance().saveCrashInfoToWeb("初始化异常,强制退出");
+                        Toast("初始化失败:强制退出" );
                         onInitFail();
                         break;
                     case ErrorCode.COM_PLATFORM_ERROR_TIME_OUT:
                         //Toast(MainActivity.this,"网络超时:" + paramInt);
                         Log.i(TAG,"网络超时");
+                        Toast("初始化失败:网络超时" );
                         CrashHandler.getInstance().saveCrashInfoToWeb("初始化失败,网络超时");
                         onInitFail();
                         break;
                     default:
                         Log.i(TAG,"其他错误:" + paramInt);
+                        Toast("初始化失败:其他错误" );
                         CrashHandler.getInstance().saveCrashInfoToWeb("初始化失败,其他错误:" + paramInt);
                         onInitFail();
                         break;
@@ -333,9 +460,54 @@ public class MainActivity extends Activity {
         });
     }
 
+    private void Auth(){
+        HuaweiPay.getInstance().authForMonth(new CallbackListener<AuthResult>() {
+            @Override
+            public void callback(int i, AuthResult authResult) {
+                switch (i){
+                    case ErrorCode.COM_PLATFORM_SUCCESS:
+                        Log.d(TAG,"是安卓会员");
+                        new LocalStore(MainActivity.this).saveIsVip(true);
+                        if(authResult!=null){
+                            Toast(authResult.description);
+                            Log.i(TAG,authResult.description);
+                        }
+                        runH5();
+                        break;
+                    case ErrorCode.COM_PLATFORM_ERROR_PARAM:
+                        Log.d(TAG,"不是安卓会员");
+                        new LocalStore(MainActivity.this).saveIsVip(false);
+                        if(authResult!=null){
+                            getBuyProductId(authResult);
+                        }
+                        runH5();
+                        Log.i(TAG,"参数错误,errorcode:" + i);
+                        break;
+                    case ErrorCode.COM_PLATFORM_ERROR_UNKNOWN:
+                        Log.d(TAG,"不是安卓会员");
+                        new LocalStore(MainActivity.this).saveIsVip(false);
+                        if(authResult!=null){
+                            getBuyProductId(authResult);
+                        }
+                        runH5();
+                        Log.i(TAG,"SDK未初始化及其它错误,errorcode:" + i);
+                        break;
+                    default:
+                        Log.d(TAG,"不是安卓会员");
+                        new LocalStore(MainActivity.this).saveIsVip(false);
+                        if(authResult!=null){
+                            getBuyProductId(authResult);
+                        }
+                        runH5();
+                        Log.i(TAG,"其他错误,errorcode:" + i);
+                        break;
+                }
+            }
+        });
+    }
 
     private void onInitFail(){
-        new AlertDialog.Builder(this)
+       /* new AlertDialog.Builder(this)
                 .setMessage("初始化失败,点击'确定'退出")
                 .setPositiveButton("确定",new DialogInterface.OnClickListener(){
 
@@ -343,7 +515,13 @@ public class MainActivity extends Activity {
                     public void onClick(DialogInterface dialog, int which) {
                         MainActivity.this.finish();
                     }
-                }).show();
+                }).show();*/
+        runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                runH5();
+            }
+        });
     }
 
     private void getBuyProductId(@NonNull AuthResult authResult){
@@ -425,14 +603,19 @@ public class MainActivity extends Activity {
         }
 
         @JavascriptInterface
-        public void play(final String url,final String title,final String sourceId){
-            listener.videoPlay(url,title,userId,sourceId);
+        public String getUserId(){
+            return HuaweiPay.getInstance().getUserId();
+        }
+
+        @JavascriptInterface
+        public void play(final String url,final String title,final String sourceId,int vipState,int isFee){
+            listener.videoPlay(url,title,userId,sourceId,vipState,isFee);
         }
 
         @JavascriptInterface
         public void pay(String backUrl){
             //Toast.makeText(MainActivity.this,"开始计费",Toast.LENGTH_SHORT).show();
-            Log.d(TAG,"限时订购计费");
+            Log.d(TAG,"限时订购计费,backUrl:" + backUrl);
             MainActivity.this.backUrl = backUrl;
             gotoPayActivity(userId,buyProductId);
         }
@@ -445,19 +628,7 @@ public class MainActivity extends Activity {
         @JavascriptInterface
         public void exit(){
             //todo run in ui thread
-            new AlertDialog.Builder(MainActivity.this)
-                    .setMessage("确认退出!")
-                    .setPositiveButton("继续观看", new DialogInterface.OnClickListener() {
-                        @Override
-                        public void onClick(DialogInterface dialog, int which) {
-
-                        }
-                    }).setNegativeButton("立即退出", new DialogInterface.OnClickListener() {
-                @Override
-                public void onClick(DialogInterface dialog, int which) {
-                    MainActivity.this.finish();
-                }
-            }).show();
+            onExit();
         }
 
         @JavascriptInterface
@@ -480,11 +651,47 @@ public class MainActivity extends Activity {
             Logger("vipState:" + (vipState?"是":"否"));
             return vipState?1:-1;
         }
+
+        @JavascriptInterface
+        public void cancelCyclePay(String tradeNo){
+            HuaweiPay.getInstance().unSubscribe(MainActivity.this, tradeNo, new CallbackListener<PayResult>() {
+                @Override
+                public void callback(int i, PayResult payResult) {
+                    if(i == ErrorCode.COM_PLATFORM_SUCCESS){
+                        MainActivity.this.runOnUiThread(new Runnable() {
+                            @Override
+                            public void run() {
+                                Toast.makeText(MainActivity.this,"取消订购平台已受理",Toast.LENGTH_SHORT).show();
+                            }
+                        });
+                    }else{
+                        Log.i("TestUnsubscribe","取消订购失败:" + i);
+                    }
+                }
+            });
+        }
+    }
+    private void onExit(){
+        //GameInterface.exit();
+        this.finish();
+       /* Intent intent = new Intent(Intent.ACTION_MAIN);
+        intent.addCategory(Intent.CATEGORY_HOME);
+        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        startActivity(intent);*/
+    }
+
+
+    private void killOriginProcess(){
+        ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
+        List<ActivityManager.RunningAppProcessInfo> runningAppProcessInfos = am.getRunningAppProcesses();
+        //Log.d("djbl","index 0 pacagename:" + runningAppProcessInfos.get(0).processName);
+        am.killBackgroundProcesses("com.haochuan.dudutoy");
     }
 
     @Override
     protected void onDestroy(){
         //清空所有Cookie
+        Log.d(TAG,"页面退出");
         CookieSyncManager.createInstance(this);  //Create a singleton CookieSyncManager within a context
         CookieManager cookieManager = CookieManager.getInstance(); // the singleton CookieManager instance
         cookieManager.removeAllCookie();// Removes all cookies.
@@ -510,8 +717,8 @@ public class MainActivity extends Activity {
         }
 
         HuaweiPay.getInstance().onDestroy();
+        killOriginProcess();
         super.onDestroy();
-
     }
 
     @Override
@@ -584,13 +791,17 @@ public class MainActivity extends Activity {
     }
 
     public interface H5Result {
-        public void videoPlay(String url,String title,String uId,String sourceId);
+        public void videoPlay(String url,String title,String uId,String sourceId,int vipState,int isFee);
     }
 
     public interface MyPayResult{
         public void onSuccess();
         public void onFail(String msg);
     }
+
+    public interface UserCheck{
+        public void isHuTongArea(Boolean result);
+    }
 }
 
 

+ 4 - 1
app/src/main/java/com/haochuan/dudutoy/PayActivity.java

@@ -3,6 +3,7 @@ package com.haochuan.dudutoy;
 import android.app.Activity;
 import android.os.Bundle;
 import android.util.Log;
+import android.widget.Toast;
 
 import com.odin.framework.plugable.Logger;
 import com.sdk.commplatform.entry.AuthResult;
@@ -79,7 +80,7 @@ public class PayActivity extends Activity {
                         }
                         if (null != arg1)
                         {
-
+                            Toast.makeText(PayActivity.this,"没有返回参数",Toast.LENGTH_SHORT).show();
                         }
                     }
                 });
@@ -89,11 +90,13 @@ public class PayActivity extends Activity {
 
    private void paySuccessResult(){
        new LocalStore(this).saveIsVip(true);
+       Toast.makeText(this,"计费成功,返回关闭页面",Toast.LENGTH_SHORT).show();
        finish();
    }
 
     private void payFailResult(){
         new LocalStore(this).saveIsVip(false);
+        Toast.makeText(this,"计费失败,返回关闭页面",Toast.LENGTH_SHORT).show();
         finish();
     }
 }

+ 0 - 43
app/src/main/java/com/haochuan/dudutoy/TestUnsubscribe.java

@@ -1,43 +0,0 @@
-package com.haochuan.dudutoy;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.Toast;
-
-import com.sdk.commplatform.entry.ErrorCode;
-import com.sdk.commplatform.entry.PayResult;
-import com.sdk.commplatform.listener.CallbackListener;
-
-public class TestUnsubscribe extends Activity {
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_test_unsubscribe);
-        Button unSubscribe = findViewById(R.id.unsubscribe);
-
-        unSubscribe.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-               HuaweiPay.getInstance().unSubscribe(TestUnsubscribe.this, "B702207712043108", new CallbackListener<PayResult>() {
-                    @Override
-                    public void callback(int i, PayResult payResult) {
-                        if(i == ErrorCode.COM_PLATFORM_SUCCESS){
-                            TestUnsubscribe.this.runOnUiThread(new Runnable() {
-                                @Override
-                                public void run() {
-                                    Toast.makeText(TestUnsubscribe.this,"取消订购平台已受理",Toast.LENGTH_SHORT).show();
-                                }
-                            });
-                        }else{
-                            Log.i("TestUnsubscribe","取消订购失败:" + i);
-                        }
-                    }
-                });
-            }
-        });
-    }
-}

+ 10 - 0
app/src/main/java/com/haochuan/dudutoy/UrlManager.java

@@ -26,4 +26,14 @@ public class UrlManager {
                 + "&uid=" + uId
                 +"&source_id=" + sourceId;
     }
+
+    public String getHeNanVipStateUrl(String userId){
+        return host + "index.php?m=Home&c=DuduApi&a=checkUserVipStatus"
+                + "&userId=" + userId;
+    }
+
+    public String getCheckAreaUrl(String userId){
+        return host + "index.php?m=Home&c=Api&a=OrderEach"
+                + "&uid=" + userId;
+    }
 }

+ 7 - 3
app/src/main/java/com/haochuan/dudutoy/VideoEndDialog.java

@@ -54,6 +54,7 @@ public class VideoEndDialog extends DialogFragment{
     private LinearLayout collectContainer;
     private ImageView collectIcon;
     private TextView collectTitle;
+    private TextView continuePlayText;
 
     private long  mLastClickTime = 0;
 
@@ -133,9 +134,11 @@ public class VideoEndDialog extends DialogFragment{
         LinearLayout exitBtn = view.findViewById(R.id.exit_play);
         collectIcon = view.findViewById(R.id.collect_icon);
         collectTitle = view.findViewById(R.id.collect_title);
+        continuePlayText = view.findViewById(R.id.continue_play_text);
 
         if(isComplete){
-            continueBtn.setVisibility(View.INVISIBLE);
+            //continueBtn.setVisibility(View.INVISIBLE);
+            continuePlayText.setText("重新播放");
         }
 
         getCollectState(new OnCollectListener(){
@@ -166,7 +169,7 @@ public class VideoEndDialog extends DialogFragment{
             @Override
             public void onClick(View v) {
                 VideoEndDialog.this.dismiss();
-                mListener.onContinuePlay();
+                mListener.onContinuePlay(isComplete);
             }
         });
 
@@ -239,6 +242,7 @@ public class VideoEndDialog extends DialogFragment{
 
     private void addCollectStateToWeb(){
         final String requestUrl = new UrlManager().addCollectedStateUrl(uId,sourceId,2);
+
         queue.add(new JsonObjectRequest(Request.Method.GET, requestUrl, null, new Response.Listener<JSONObject>() {
             @Override
             public void onResponse(JSONObject response) {
@@ -330,7 +334,7 @@ public class VideoEndDialog extends DialogFragment{
     public interface OnClickListener{
         public void onExit();
         public void onDismiss();
-        public void onContinuePlay();
+        public void onContinuePlay(boolean isComplete);
     }
 
 }

+ 26 - 0
app/src/main/java/com/haochuan/dudutoy/VideoInfo.java

@@ -0,0 +1,26 @@
+package com.haochuan.dudutoy;
+
+import com.boredream.bdvideoplayer.bean.IVideoInfo;
+
+/**
+ * Created by 浩传 on 2018/7/26.
+ */
+
+public class VideoInfo implements IVideoInfo {
+    private String title;
+    private String videoPath;
+
+    public VideoInfo(String title, String videoPath){
+        this.title =title;
+        this.videoPath = videoPath;
+    }
+    @Override
+    public String getVideoTitle() {
+        return title;
+    }
+
+    @Override
+    public String getVideoPath() {
+        return videoPath;
+    }
+}

+ 95 - 52
app/src/main/java/com/haochuan/dudutoy/VideoPlayerActivity.java

@@ -1,16 +1,11 @@
 package com.haochuan.dudutoy;
 
 import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
-import android.util.Log;
 import android.view.KeyEvent;
-import android.view.View;
 import android.widget.Toast;
 
 import com.android.volley.Request;
@@ -19,26 +14,24 @@ import com.android.volley.Response;
 import com.android.volley.VolleyError;
 import com.android.volley.toolbox.JsonObjectRequest;
 import com.android.volley.toolbox.Volley;
-import com.odin.framework.plugable.Logger;
-import com.sdk.commplatform.entry.ErrorCode;
-import com.sdk.commplatform.entry.PayResult;
-import com.sdk.commplatform.listener.CallbackListener;
-import com.shuyu.gsyvideoplayer.GSYVideoADManager;
-import com.shuyu.gsyvideoplayer.GSYVideoManager;
-import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
+import com.boredream.bdvideoplayer.BDVideoView;
+import com.haochuan.dudutoy.R;
 
 import org.json.JSONObject;
 
 import java.util.Timer;
 import java.util.TimerTask;
 
-public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnClickListener{
+public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnClickListener,BDVideoView.BdPlayerListener{
 
     String uId = "";
     String sourceId = "";
+    int isFee = 2; //1,免费;2.收费;
+    int vipState = -1 ; //1,会员;-1非会员
 
     private boolean showVideoEndDialog = false;
-    DuduPlayer duduPlayer;
+    BDVideoView bdVideoView;
+
 
     private int seekPercent = 5;
 
@@ -52,13 +45,24 @@ public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnCl
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_video_player);
         String url = getIntent().getStringExtra("url");
+        //url = "http://111.20.106.4:6610/GZHC/2/HC_SXYD_Movie_1363/index.m3u8?terminalflag=1&version=v1.0&IASHttpSessionId=SLB78702018121308463812310545&AuthInfo=4NcljpDogEuHBjsHpq6BgQ1RiAQxbV7WrT%2BzwsRgDbYIWC3uCzqbr%2B91hWjjvLUJzqkPO6Jqmqx1XrDRBIqqShH0f9TXcXRhuaKjWyAnfINDXqjVU%2FIcEEqs6Z%2FX0sF9&userid=D071C46F2ECB&stbid=CF570300004735100000D071C46F2ECB&virtualDomain=GZHC.vod_hls.zte.com";
         String title = getIntent().getStringExtra("title");
         uId = getIntent().getStringExtra("uId");
         sourceId = getIntent().getStringExtra("sourceId");
+        isFee = getIntent().getIntExtra("isFee",2);
+        vipState = getIntent().getIntExtra("vipState",-1);
+
        /* url = "http://202.99.114.93/88888891/16/20171229/269788225/269788225.ts";
         title = "小小战士";*/
-        duduPlayer = findViewById(R.id.video_player);
-        duduPlayer.setUp(url, false,title);
+        bdVideoView = findViewById(R.id.bd_player);
+        bdVideoView.setActivity(this);
+        VideoInfo info = new VideoInfo(title,url);
+
+        bdVideoView.startPlayVideo(info);
+
+        bdVideoView.setBdPlayerListener(this);
+
+        /*duduPlayer.setUp(url, false,title);
         duduPlayer.clickStartIcon();
 
         duduPlayer.setOnCompleteListener(new DuduPlayer.OnCompleteListener() {
@@ -77,16 +81,17 @@ public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnCl
                 },1000);
 
             }
-        });
+        });*/
         addHistoryToWeb();
 
-        if(!new LocalStore(this).getIsVip()){
-            initPayTimeTask();
-            Toast.makeText(this,"您还不是会员,您只可以试看30秒视频!并且不能快进",Toast.LENGTH_LONG).show();
+        if(vipState == -1){
+            if(isFee != 1){
+                initPayTimeTask();
+                Toast.makeText(this,"您还不是会员,您只可以试看30秒视频!并且不能快进",Toast.LENGTH_LONG).show();
+            }
         }
     }
 
-
     private void addHistoryToWeb(){
         final String requestUrl = new UrlManager().addCollectedStateUrl(uId,sourceId,1);
         RequestQueue queue = Volley.newRequestQueue(this);
@@ -111,21 +116,23 @@ public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnCl
                 playOrPause();
                 return true;
             case KeyEvent.KEYCODE_DPAD_LEFT:
-                if(duduPlayer.canSeek()){
+                if(bdVideoView.canSeek()){
                     seekBack();
                 }else{
-                    //Toast.makeText(VideoPlayerActivity.this,"视频准备中,暂时不能拖动快进",Toast.LENGTH_SHORT).show();
+                    Toast.makeText(VideoPlayerActivity.this,"视频准备中,暂时不能拖动快进",Toast.LENGTH_SHORT).show();
                 }
                 return true;
             case KeyEvent.KEYCODE_DPAD_RIGHT:
-                if(duduPlayer.canSeek()){
+                //seekForward();
+                if(bdVideoView.canSeek()){
                     seekForward();
                 }else{
-                    //Toast.makeText(VideoPlayerActivity.this,"视频准备中,暂时不能拖动快进",Toast.LENGTH_SHORT).show();
+                    Toast.makeText(VideoPlayerActivity.this,"视频准备中,暂时不能拖动快进",Toast.LENGTH_SHORT).show();
                 }
                 return true;
             case KeyEvent.KEYCODE_BACK:      //到顶跳到相应tab
-                duduPlayer.pause();
+               /* duduPlayer.pause();*/
+                bdVideoView.pause();
                 if(!showVideoEndDialog){
                     if(Build.VERSION.SDK_INT> 15){
                         showVideoEndDialog();
@@ -142,37 +149,41 @@ public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnCl
     }
 
     private void playOrPause(){
-       duduPlayer.playOrPause();
+        bdVideoView.playOrPause();
     }
 
     private void seekBack(){
-        if(!new LocalStore(this).getIsVip()){
-            return;
+        if(vipState == -1){
+            if(isFee != 1){
+                return;
+            }
         }
-        int seekCount = duduPlayer.getDuration()*seekPercent/100;
+        int seekCount = bdVideoView.getDuration()*seekPercent/100;
         int position = 0;
-        if(duduPlayer.getCurrentPositionWhenPlaying() - seekCount > 0) {
-            position = (duduPlayer.getCurrentPositionWhenPlaying() - seekCount) * 1000/ duduPlayer.getDuration();
+        if(bdVideoView.getCurrentPositionWhenPlaying() - seekCount > 0) {
+            position = (bdVideoView.getCurrentPositionWhenPlaying() - seekCount) * 1000/ bdVideoView.getDuration();
         }
         if(position<= 0){
             return;
         }
-        duduPlayer.seek(position);
+        bdVideoView.seek(position);
     }
 
     private void seekForward(){
-        if(!new LocalStore(this).getIsVip()){
-            return;
+        if(vipState == -1){
+            if(isFee != 1){
+                return;
+            }
         }
-        int seekCount = duduPlayer.getDuration()*seekPercent/100;
-        int position = duduPlayer.getDuration();
-        if(duduPlayer.getCurrentPositionWhenPlaying() + seekCount <= duduPlayer.getDuration()) {
-            position = (duduPlayer.getCurrentPositionWhenPlaying() + seekCount) *1000/ duduPlayer.getDuration();
+        int seekCount = bdVideoView.getDuration()*seekPercent/100;
+        int position = bdVideoView.getDuration();
+        if(bdVideoView.getCurrentPositionWhenPlaying() + seekCount <= bdVideoView.getDuration()) {
+            position = (bdVideoView.getCurrentPositionWhenPlaying() + seekCount) *1000/ bdVideoView.getDuration();
         }
         if(position>=1000){
             return;
         }
-        duduPlayer.seek(position);
+        bdVideoView.seek(position);
     }
 
 
@@ -210,7 +221,7 @@ public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnCl
                                     @Override
                                     public void run() {
                                         //Toast.makeText(CntvPlayerActivity.this,"监控计费时间",Toast.LENGTH_SHORT).show();
-                                        int pos = duduPlayer.getCurrentPositionWhenPlaying();
+                                        int pos = bdVideoView.getCurrentPositionWhenPlaying();
                                         if(pos/1000 > 30){
                                             //跳转到计费界面
                                             VideoPlayerActivity.this.runOnUiThread(new Runnable() {
@@ -232,39 +243,53 @@ public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnCl
         timer_pay.schedule(task_pay,0,1000);
     }
 
+    @Override
+    protected void onStart() {
+        super.onStart();
+        if(bdVideoView != null){
+            bdVideoView.onStart();
+        }
+    }
 
     @Override
     protected void onPause() {
         super.onPause();
-        if(duduPlayer != null){
+       /* if(duduPlayer != null){
             duduPlayer.pause();
-        }
-    }
-
+        }*/
 
+    }
 
 
     @Override
     protected void onResume() {
         super.onResume();
-        if(duduPlayer != null){
+        /*if(duduPlayer != null){
             duduPlayer.play();
-        }
+        }*/
+
     }
 
     @Override
     protected void onStop(){
         super.onStop();
+        if(bdVideoView != null){
+            bdVideoView.onStop();
+        }
         this.finish();
     }
 
     @Override
     protected void onDestroy() {
-        duduPlayer.setVideoAllCallBack(null);
+       /* duduPlayer.setVideoAllCallBack(null);
         GSYVideoManager.releaseAllVideos();
         duduPlayer.onDestroy();
 
-        duduPlayer = null;
+        duduPlayer = null;*/
+
+        if(bdVideoView != null){
+            bdVideoView.onDestroy();
+        }
         if(timer_pay != null){
             timer_pay.cancel();
         }
@@ -284,15 +309,33 @@ public class VideoPlayerActivity extends Activity implements VideoEndDialog.OnCl
     @Override
     public void onDismiss() {
         showVideoEndDialog = false;
-        if(duduPlayer!=null){
+       /* if(duduPlayer!=null){
             duduPlayer.play();
+        }*/
+        if(bdVideoView != null){
+            bdVideoView.play();
         }
     }
 
     @Override
-    public void onContinuePlay() {
-        if(duduPlayer != null){
+    public void onContinuePlay(boolean isComplete) {
+       /* if(duduPlayer != null){
             duduPlayer.play();
+        }*/
+        if(!isComplete){
+            if(bdVideoView != null){
+                bdVideoView.play();
+            }
+        }else{
+            if(bdVideoView != null){
+                bdVideoView.restart();
+            }
         }
+
+    }
+
+    @Override
+    public void onComplete() {
+        showVideoEndDialogComplete();
     }
 }

BIN=BIN
app/src/main/res/drawable-hdpi/btn_icon_right.png


BIN=BIN
app/src/main/res/drawable-hdpi/btn_icon_stop.png


BIN=BIN
app/src/main/res/drawable-hdpi/loading_1.png


BIN=BIN
app/src/main/res/drawable-hdpi/loading_2.png


BIN=BIN
app/src/main/res/drawable-hdpi/logo_icon_down.png


BIN=BIN
app/src/main/res/drawable-hdpi/logo_icon_left.png


BIN=BIN
app/src/main/res/drawable-hdpi/logo_icon_ok.png


BIN=BIN
app/src/main/res/drawable-hdpi/logo_icon_right.png


BIN=BIN
app/src/main/res/drawable-ldpi/loading_1.png


BIN=BIN
app/src/main/res/drawable-ldpi/loading_2.png


BIN=BIN
app/src/main/res/drawable-ldpi/logo_icon_down.png


BIN=BIN
app/src/main/res/drawable-ldpi/logo_icon_left.png


BIN=BIN
app/src/main/res/drawable-ldpi/logo_icon_ok.png


BIN=BIN
app/src/main/res/drawable-ldpi/logo_icon_right.png


BIN=BIN
app/src/main/res/drawable-mdpi/loading_1.png


BIN=BIN
app/src/main/res/drawable-mdpi/loading_2.png


BIN=BIN
app/src/main/res/drawable-mdpi/logo_icon_down.png


BIN=BIN
app/src/main/res/drawable-mdpi/logo_icon_left.png


BIN=BIN
app/src/main/res/drawable-mdpi/logo_icon_ok.png


BIN=BIN
app/src/main/res/drawable-mdpi/logo_icon_right.png


BIN=BIN
app/src/main/res/drawable-xhdpi/loading_1.png


BIN=BIN
app/src/main/res/drawable-xhdpi/loading_2.png


BIN=BIN
app/src/main/res/drawable-xhdpi/logo_icon_down.png


BIN=BIN
app/src/main/res/drawable-xhdpi/logo_icon_left.png


BIN=BIN
app/src/main/res/drawable-xhdpi/logo_icon_ok.png


BIN=BIN
app/src/main/res/drawable-xhdpi/logo_icon_right.png


BIN=BIN
app/src/main/res/drawable-xxhdpi/loading_1.png


BIN=BIN
app/src/main/res/drawable-xxhdpi/loading_2.png


BIN=BIN
app/src/main/res/drawable-xxhdpi/logo_icon_down.png


BIN=BIN
app/src/main/res/drawable-xxhdpi/logo_icon_left.png


BIN=BIN
app/src/main/res/drawable-xxhdpi/logo_icon_ok.png


BIN=BIN
app/src/main/res/drawable-xxhdpi/logo_icon_right.png


+ 4 - 2
app/src/main/res/layout/activity_video_player.xml

@@ -5,8 +5,10 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     tools:context="com.haochuan.dudutoy.VideoPlayerActivity">
-    <com.haochuan.dudutoy.DuduPlayer
+    <com.boredream.bdvideoplayer.BDVideoView
+        android:id="@+id/bd_player"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:id="@+id/video_player"/>
+        >
+    </com.boredream.bdvideoplayer.BDVideoView>
 </android.support.constraint.ConstraintLayout>

+ 1 - 0
app/src/main/res/layout/dialog_video_end.xml

@@ -34,6 +34,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginLeft="@dimen/end_btn_back_text_margin_left"
+            android:id="@+id/continue_play_text"
             android:textColor="#FFE6FBFF"
             android:textSize="@dimen/time_text_size"
             android:text="继续播放"/>

+ 0 - 297
app/src/main/res/layout/du_du_player.xml

@@ -1,297 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    xmlns:custom="http://schemas.android.com/apk/res-auto">
-    <RelativeLayout
-        android:id="@+id/surface_container"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:gravity="center">
-    </RelativeLayout>
-
-    <RelativeLayout
-        android:id="@+id/thumb"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_alignParentBottom="true"
-        android:layout_alignParentEnd="true"
-        android:layout_alignParentLeft="true"
-        android:layout_alignParentRight="true"
-        android:layout_alignParentStart="true"
-        android:layout_alignParentTop="true"
-        android:background="#000000"
-        android:scaleType="fitCenter" />
-
-    <LinearLayout
-        android:id="@+id/layout_bottom"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/bottom_bar_height"
-        android:layout_alignParentBottom="true"
-        android:background="#B3000000"
-        android:gravity="center_vertical"
-        android:orientation="horizontal"
-        android:visibility="visible">
-
-        <ImageView
-            android:layout_width="@dimen/icon_size"
-            android:layout_height="@dimen/icon_size"
-            android:id="@+id/dudu_start_btn"
-            android:layout_marginLeft="@dimen/play_btn_margin_left"
-            android:src="@drawable/btn_icon_stop"/>
-
-        <SeekBar
-            android:id="@+id/progress"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_vertical"
-            android:layout_weight="1.0"
-            android:layout_marginLeft="@dimen/seek_bar_margin_left"
-            android:background="@null"
-            android:max="100"
-            android:maxHeight="4dp"
-            android:minHeight="4dp"
-            android:paddingBottom="8dp"
-            android:paddingTop="8dp"
-            android:paddingLeft="@dimen/video_seek_thumb_padding_left"
-            android:focusable="false"
-            android:progressDrawable="@drawable/dudu_video_seek_progress"
-            android:thumb="@drawable/video_seek_thumb_normal" />
-
-        <TextView
-            android:id="@+id/current"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="@dimen/time_margin_left"
-            android:textSize="@dimen/time_text_size"
-            android:text="00:00"
-            android:textColor="#FFEDF3F7" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="/"
-            android:textSize="@dimen/time_text_size"
-            android:textColor="#FFEDF3F7" />
-
-        <TextView
-            android:id="@+id/total"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginRight="16dp"
-            android:textSize="@dimen/time_text_size"
-            android:text="00:00"
-            android:textColor="#FFEDF3F7"
-            android:layout_marginEnd="16dp"/>
-
-        <ImageView
-            android:id="@+id/fullscreen"
-            android:layout_width="wrap_content"
-            android:layout_height="fill_parent"
-            android:paddingRight="16dp"
-            android:scaleType="center"
-            android:visibility="gone"
-            android:src="@drawable/video_enlarge" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:id="@+id/seek_container"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/bottom_bar_height"
-        android:layout_alignParentBottom="true"
-        android:background="#B3000000"
-        android:gravity="center_vertical"
-        android:orientation="horizontal"
-        android:visibility="invisible">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textSize="@dimen/time_text_size"
-            android:visibility="visible"
-            android:id="@+id/percent_text"
-            android:layout_marginLeft="@dimen/play_btn_margin_left" />
-
-
-        <SeekBar
-            android:id="@+id/seek_bar"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_vertical"
-            android:layout_weight="1.0"
-            android:layout_marginLeft="@dimen/seek_bar_margin_left"
-            android:background="@null"
-            android:max="1000"
-            android:maxHeight="4dp"
-            android:minHeight="4dp"
-            android:paddingBottom="8dp"
-            android:paddingTop="8dp"
-            android:paddingLeft="@dimen/video_seek_thumb_padding_left"
-            android:paddingRight="@dimen/video_seek_thumb_padding_left"
-            android:progressDrawable="@drawable/dudu_video_seek_progress"
-            android:thumb="@drawable/video_seek_thumb_normal" />
-
-
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginRight="16dp"
-            android:visibility="visible"
-            android:textSize="@dimen/time_text_size"
-            android:text="00:00"
-            android:id="@+id/duration_text"
-            android:textColor="#FFEDF3F7"
-            android:layout_marginEnd="@dimen/loading_text_size"/>
-
-
-    </LinearLayout>
-
-    <ProgressBar
-        android:id="@+id/bottom_progressbar"
-        style="?android:attr/progressBarStyleHorizontal"
-        android:layout_width="match_parent"
-        android:layout_height="1.5dp"
-        android:layout_alignParentBottom="true"
-        android:max="100"
-        android:progressDrawable="@drawable/video_progress" />
-
-    <ImageView
-        android:id="@+id/back_tiny"
-        android:layout_width="24dp"
-        android:layout_height="24dp"
-        android:layout_marginLeft="6dp"
-        android:layout_marginTop="6dp"
-        android:visibility="gone" />
-
-    <LinearLayout
-        android:id="@+id/layout_top"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/top_bar_height"
-        android:background="#B3000000"
-        android:gravity="center_vertical">
-
-        <ImageView
-            android:id="@+id/back"
-            android:layout_width="48dp"
-            android:layout_height="48dp"
-            android:paddingLeft="10dp"
-            android:scaleType="centerInside"
-            android:visibility="gone"
-            android:src="@drawable/video_back" />
-        <LinearLayout
-            android:layout_width="@dimen/top_bar_title_container_width"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="@dimen/top_bar_title_margin_left">
-            <TextView
-                android:id="@+id/title"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textColor="@color/light1"
-                android:layout_gravity="center_vertical"
-                android:maxLines="1"
-                android:ellipsize="end"
-                android:textSize="@dimen/top_bar_title_text_size" />
-        </LinearLayout>
-
-
-        <ImageView
-            android:layout_width="@dimen/icon_size"
-            android:layout_height="@dimen/icon_size"
-            android:src="@drawable/logo_icon_ok"
-            />
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="暂停/播放"
-            android:textSize="@dimen/time_text_size"
-            android:layout_marginLeft="@dimen/top_bar_explain_margin_left"/>
-
-        <ImageView
-            android:layout_width="@dimen/icon_size"
-            android:layout_height="@dimen/icon_size"
-            android:src="@drawable/logo_icon_left"
-            android:layout_marginLeft="@dimen/top_bar_explainItem_margin_left"/>
-        <ImageView
-            android:layout_width="@dimen/icon_size"
-            android:layout_height="@dimen/icon_size"
-            android:src="@drawable/logo_icon_right"
-            android:layout_marginLeft="@dimen/top_bar_icon_between"/>
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="快进/快退"
-            android:textSize="@dimen/time_text_size"
-            android:layout_marginLeft="@dimen/top_bar_explain_margin_left"/>
-
-        <ImageView
-            android:layout_width="@dimen/icon_size"
-            android:layout_height="@dimen/icon_size"
-            android:src="@drawable/logo_icon_down"
-            android:visibility="gone"
-            android:layout_marginLeft="@dimen/top_bar_explainItem_margin_left"/>
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="菜单栏"
-            android:textSize="@dimen/time_text_size"
-            android:visibility="gone"
-            android:layout_marginLeft="@dimen/top_bar_explain_margin_left"/>
-    </LinearLayout>
-
-    <RelativeLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_centerHorizontal="true"
-        android:layout_centerVertical="true"
-        android:visibility="visible"
-        android:id="@+id/loading">
-        <ImageView
-            android:layout_width="@dimen/loading_width"
-            android:layout_height="@dimen/loading_height"
-            android:id="@+id/loading_anim"
-            />
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/loading_text"
-            android:textSize="@dimen/loading_text_size"
-            android:gravity="center_horizontal"
-            android:textColor="#FFFFFF"
-            android:layout_centerHorizontal="true"
-            android:layout_marginTop="@dimen/loading_text_margin_top"
-            />
-    </RelativeLayout>
-
-
-    <moe.codeest.enviews.ENPlayView
-        android:id="@+id/start"
-        android:layout_width="60dp"
-        android:layout_height="60dp"
-        android:layout_centerHorizontal="true"
-        android:layout_centerVertical="true"
-        android:layout_gravity="center_vertical"
-        android:visibility="gone"/>
-
-
-    <ImageView
-        android:id="@+id/small_close"
-        android:layout_width="30dp"
-        android:layout_height="30dp"
-        android:paddingLeft="10dp"
-        android:paddingTop="10dp"
-        android:scaleType="centerInside"
-        android:src="@drawable/video_small_close"
-        android:visibility="gone" />
-
-    <ImageView
-        android:id="@+id/lock_screen"
-        android:layout_width="30dp"
-        android:layout_height="30dp"
-        android:layout_alignParentRight="true"
-        android:layout_centerVertical="true"
-        android:layout_marginRight="50dp"
-        android:visibility="gone"
-        android:scaleType="centerInside"
-        android:src="@drawable/unlock" />
-</RelativeLayout>

+ 0 - 5
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
-    <background android:drawable="@drawable/ic_launcher_background" />
-    <foreground android:drawable="@drawable/ic_launcher_foreground" />
-</adaptive-icon>

+ 0 - 5
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
-    <background android:drawable="@drawable/ic_launcher_background" />
-    <foreground android:drawable="@drawable/ic_launcher_foreground" />
-</adaptive-icon>

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -1,4 +1,4 @@
 <resources>
-    <string name="app_name">DuduToy</string>
+    <string name="app_name">嘟嘟玩具王国</string>
     <string name="loading_text">精彩即将呈现\n...</string>
 </resources>

BIN=BIN
release/app-release.apk


BIN=BIN
release/dudutoy.apk


+ 1 - 1
release/output.json

@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.haochuan.dudutoy","split":"","minSdkVersion":"15"}}]
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":6},"path":"app-release.apk","properties":{"packageId":"com.haochuan.dudutoy","split":"","minSdkVersion":"15"}}]

+ 1 - 1
settings.gradle

@@ -1 +1 @@
-include ':app', ':TvSDK_Lib_Project'
+include ':app', ':bdvideoplayer', ':TvSDK_Lib_Project'