-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathFullScreenActivity.java
71 lines (60 loc) · 2.02 KB
/
FullScreenActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package jaygoo.m3u8downloader;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
import com.shuyu.gsyvideoplayer.video.base.GSYVideoPlayer;
import jaygoo.library.m3u8downloader.server.EncryptM3U8Server;
/**
* ================================================
* 作 者:JayGoo
* 版 本:
* 创建日期:2017/11/21
* 描 述:
* ================================================
*/
public class FullScreenActivity extends Activity{
private StandardGSYVideoPlayer videoPlayer;
private EncryptM3U8Server m3u8Server = new EncryptM3U8Server();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fullscreen);
videoPlayer = (StandardGSYVideoPlayer)findViewById(R.id.videoView);
String url = null;
Bundle bundle = getIntent().getExtras();
if (bundle != null){
url = bundle.getString("M3U8_URL");
}
m3u8Server.execute();
videoPlayer.getCurrentPlayer().setUp(m3u8Server.createLocalHttpUrl(url),false,"");
videoPlayer.startWindowFullscreen(this,false,false);
videoPlayer.setBackFromFullScreenListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
videoPlayer.getCurrentPlayer().startPlayLogic();
}
@Override
protected void onResume() {
super.onResume();
m3u8Server.decrypt();
}
@Override
protected void onPause() {
super.onPause();
m3u8Server.encrypt();
}
@Override
protected void onDestroy() {
super.onDestroy();
m3u8Server.finish();
//释放所有
videoPlayer.getCurrentPlayer().release();
GSYVideoPlayer.releaseAllVideos();
videoPlayer.setStandardVideoAllCallBack(null);
}
}