{
6 |
7 | public abstract P createPlayer(Context context);
8 | }
9 |
--------------------------------------------------------------------------------
/dkplayer-java/src/main/java/com/dueeeke/videoplayer/player/ProgressManager.java:
--------------------------------------------------------------------------------
1 | package com.dueeeke.videoplayer.player;
2 |
3 | public abstract class ProgressManager {
4 |
5 | public abstract void saveProgress(String url, long progress);
6 |
7 | public abstract long getSavedProgress(String url);
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/dkplayer-java/src/main/java/com/dueeeke/videoplayer/render/IRenderView.java:
--------------------------------------------------------------------------------
1 | package com.dueeeke.videoplayer.render;
2 |
3 | import android.graphics.Bitmap;
4 | import android.view.View;
5 |
6 | import androidx.annotation.NonNull;
7 |
8 | import com.dueeeke.videoplayer.player.AbstractPlayer;
9 |
10 | public interface IRenderView {
11 |
12 | /**
13 | * 关联AbstractPlayer
14 | */
15 | void attachToPlayer(@NonNull AbstractPlayer player);
16 |
17 | /**
18 | * 设置视频宽高
19 | * @param videoWidth 宽
20 | * @param videoHeight 高
21 | */
22 | void setVideoSize(int videoWidth, int videoHeight);
23 |
24 | /**
25 | * 设置视频旋转角度
26 | * @param degree 角度值
27 | */
28 | void setVideoRotation(int degree);
29 |
30 | /**
31 | * 设置screen scale type
32 | * @param scaleType 类型
33 | */
34 | void setScaleType(int scaleType);
35 |
36 | /**
37 | * 获取真实的RenderView
38 | */
39 | View getView();
40 |
41 | /**
42 | * 截图
43 | */
44 | Bitmap doScreenShot();
45 |
46 | /**
47 | * 释放资源
48 | */
49 | void release();
50 |
51 | }
--------------------------------------------------------------------------------
/dkplayer-java/src/main/java/com/dueeeke/videoplayer/render/RenderViewFactory.java:
--------------------------------------------------------------------------------
1 | package com.dueeeke.videoplayer.render;
2 |
3 | import android.content.Context;
4 |
5 | public abstract class RenderViewFactory {
6 |
7 | public abstract IRenderView createRenderView(Context context);
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/dkplayer-java/src/main/java/com/dueeeke/videoplayer/render/TextureRenderViewFactory.java:
--------------------------------------------------------------------------------
1 | package com.dueeeke.videoplayer.render;
2 |
3 | import android.content.Context;
4 |
5 | public class TextureRenderViewFactory extends RenderViewFactory {
6 |
7 | public static TextureRenderViewFactory create() {
8 | return new TextureRenderViewFactory();
9 | }
10 |
11 | @Override
12 | public IRenderView createRenderView(Context context) {
13 | return new TextureRenderView(context);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/dkplayer-java/src/main/java/com/dueeeke/videoplayer/util/L.java:
--------------------------------------------------------------------------------
1 | package com.dueeeke.videoplayer.util;
2 |
3 | import android.util.Log;
4 |
5 | import com.dueeeke.videoplayer.player.VideoViewManager;
6 |
7 | /**
8 | * 日志类
9 | * Created by dueeeke on 2017/6/5.
10 | */
11 |
12 | public final class L {
13 |
14 | private L() {
15 | }
16 |
17 | private static final String TAG = "DKPlayer";
18 |
19 | private static boolean isDebug = VideoViewManager.getConfig().mIsEnableLog;
20 |
21 |
22 | public static void d(String msg) {
23 | if (isDebug) {
24 | Log.d(TAG, msg);
25 | }
26 | }
27 |
28 | public static void e(String msg) {
29 | if (isDebug) {
30 | Log.e(TAG, msg);
31 | }
32 | }
33 |
34 | public static void i(String msg) {
35 | if (isDebug) {
36 | Log.i(TAG, msg);
37 | }
38 | }
39 |
40 | public static void w(String msg) {
41 | if (isDebug) {
42 | Log.w(TAG, msg);
43 | }
44 | }
45 |
46 | public static void setDebug(boolean isDebug) {
47 | L.isDebug = isDebug;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/dkplayer-java/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 | * It is important to ignore system proxy for localhost connection.
17 | *
18 | * @author Alexey Danilov (danikula@gmail.com).
19 | */
20 | class IgnoreHostProxySelector extends ProxySelector {
21 |
22 | private static final List