JCVideoPlayerManager.java
1.17 KB
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
package videoplayer_lib;
/**
* Put JCVideoPlayer into layout
* From a JCVideoPlayer to another JCVideoPlayer
* Created by Nathen on 16/7/26.
*/
public class JCVideoPlayerManager {
public static JCVideoPlayer FIRST_FLOOR_JCVD;
public static JCVideoPlayer SECOND_FLOOR_JCVD;
public static void setFirstFloor(JCVideoPlayer jcVideoPlayer) {
FIRST_FLOOR_JCVD = jcVideoPlayer;
}
public static void setSecondFloor(JCVideoPlayer jcVideoPlayer) {
SECOND_FLOOR_JCVD = jcVideoPlayer;
}
public static JCVideoPlayer getFirstFloor() {
return FIRST_FLOOR_JCVD;
}
public static JCVideoPlayer getSecondFloor() {
return SECOND_FLOOR_JCVD;
}
public static JCVideoPlayer getCurrentJcvd() {
if (getSecondFloor() != null) {
return getSecondFloor();
}
return getFirstFloor();
}
public static void completeAll() {
if (SECOND_FLOOR_JCVD != null) {
SECOND_FLOOR_JCVD.onCompletion();
SECOND_FLOOR_JCVD = null;
}
if (FIRST_FLOOR_JCVD != null) {
FIRST_FLOOR_JCVD.onCompletion();
FIRST_FLOOR_JCVD = null;
}
}
}