Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Dec 31, 2015
2 parents 1e71319 + c34cd3d commit cc7d016
Show file tree
Hide file tree
Showing 14 changed files with 268 additions and 65 deletions.
42 changes: 42 additions & 0 deletions app/src/main/java/fm/jiecao/jiecaovideoplayer/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import de.greenrobot.event.EventBus;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;
import fm.jiecao.jcvideoplayer_lib.VideoEvents;

public class MainActivity extends AppCompatActivity {
JCVideoPlayer videoController1, videoController2;
Expand All @@ -23,6 +26,45 @@ protected void onCreate(Bundle savedInstanceState) {
videoController2.setUp("http://2449.vod.myqcloud.com/2449_a80a72289b1211e5a28d6dc08193c3c9.f20.mp4",
"http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1449294460.jpg",
"嫂子还摸我", false, false);
EventBus.getDefault().register(this);
}

@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}

public void onEventMainThread(VideoEvents event) {
if (event.type == VideoEvents.POINT_START_ICON) {
Log.i("Video Event", "POINT_START_ICON");
} else if (event.type == VideoEvents.POINT_START_THUMB) {
Log.i("Video Event", "POINT_START_THUMB");
} else if (event.type == VideoEvents.POINT_STOP) {
Log.i("Video Event", "POINT_STOP");
} else if (event.type == VideoEvents.POINT_STOP_FULLSCREEN) {
Log.i("Video Event", "POINT_STOP_FULLSCREEN");
} else if (event.type == VideoEvents.POINT_RESUME) {
Log.i("Video Event", "POINT_RESUME");
} else if (event.type == VideoEvents.POINT_RESUME_FULLSCREEN) {
Log.i("Video Event", "POINT_RESUME_FULLSCREEN");
} else if (event.type == VideoEvents.POINT_CLICK_BLANK) {
Log.i("Video Event", "POINT_CLICK_BLANK");
} else if (event.type == VideoEvents.POINT_CLICK_BLANK_FULLSCREEN) {
Log.i("Video Event", "POINT_CLICK_BLANK_FULLSCREEN");
} else if (event.type == VideoEvents.POINT_CLICK_SEEKBAR) {
Log.i("Video Event", "POINT_CLICK_SEEKBAR");
} else if (event.type == VideoEvents.POINT_CLICK_SEEKBAR_FULLSCREEN) {
Log.i("Video Event", "POINT_CLICK_SEEKBAR_FULLSCREEN");
} else if (event.type == VideoEvents.POINT_AUTO_COMPLETE) {
Log.i("Video Event", "POINT_AUTO_COMPLETE");
} else if (event.type == VideoEvents.POINT_AUTO_COMPLETE_FULLSCREEN) {
Log.i("Video Event", "POINT_AUTO_COMPLETE_FULLSCREEN");
} else if (event.type == VideoEvents.POINT_ENTER_FULLSCREEN) {
Log.i("Video Event", "POINT_ENTER_FULLSCREEN");
} else if (event.type == VideoEvents.POINT_QUIT_FULLSCREEN) {
Log.i("Video Event", "POINT_QUIT_FULLSCREEN");
}
// Log.i("Video Event", "type : " + event.type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static void toActivity(Context context, int state, String url, String thu
public static String URL;
public static String TITLE;
public static String THUMB;
public static boolean manualQuit = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -46,9 +47,10 @@ protected void onCreate(Bundle savedInstanceState) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.activity_fullscreen);
jcVideoPlayer = (JCVideoPlayer) findViewById(R.id.jcvideoplayer);
jcVideoPlayer.setUp(URL, THUMB, TITLE, true);
jcVideoPlayer.setUpForFullscreen(URL, THUMB, TITLE, true);
jcVideoPlayer.setState(STATE);
JCMediaPlayer.intance().setUuid(jcVideoPlayer.uuid);
manualQuit = false;
}

public void onEventMainThread(VideoEvents videoEvents) {
Expand All @@ -62,6 +64,15 @@ public void onBackPressed() {
jcVideoPlayer.quitFullScreen();
}

@Override
protected void onPause() {
super.onPause();
if (!manualQuit) {
JCVideoPlayer.releaseAllVideo();
finish();
}
}

@Override
protected void onStart() {
super.onStart();
Expand All @@ -73,4 +84,5 @@ protected void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public boolean onError(MediaPlayer mp, int what, int extra) {

public void setUuid(String uuid) {
Log.i("uuid::", "0 " + uuid + " prevuuid " + prev_uuid);
backUpUuid();
// backUpUuid();
this.uuid = uuid;
Log.i("uuid::", "1 " + uuid + " prevuuid " + prev_uuid);
}
Expand All @@ -94,6 +94,7 @@ public void backUpUuid() {

public void revertUuid() {
this.uuid = this.prev_uuid;
this.prev_uuid = "";
Log.i("uuid::", "2 " + uuid + " prevuuid " + prev_uuid);
}

Expand Down
Loading

0 comments on commit cc7d016

Please sign in to comment.