3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.dl7.player.utils;
18 |
19 | import android.os.Build;
20 | import android.os.Environment;
21 | import android.os.StatFs;
22 |
23 | import java.io.File;
24 |
25 | /**
26 | * SD卡工具箱
27 | */
28 | public class SDCardUtils {
29 | /**
30 | * 获取SD卡的状态
31 | */
32 | public static String getState() {
33 | return Environment.getExternalStorageState();
34 | }
35 |
36 |
37 | /**
38 | * SD卡是否可用
39 | *
40 | * @return 只有当SD卡已经安装并且准备好了才返回true
41 | */
42 | public static boolean isAvailable() {
43 | return getState().equals(Environment.MEDIA_MOUNTED);
44 | }
45 |
46 |
47 | /**
48 | * 获取SD卡的根目录
49 | *
50 | * @return null:不存在SD卡
51 | */
52 | public static File getRootDirectory() {
53 | return isAvailable() ? Environment.getExternalStorageDirectory() : null;
54 | }
55 |
56 |
57 | /**
58 | * 获取SD卡的根路径
59 | *
60 | * @return null:不存在SD卡
61 | */
62 | public static String getRootPath() {
63 | File rootDirectory = getRootDirectory();
64 | return rootDirectory != null ? rootDirectory.getPath() : null;
65 | }
66 |
67 | /**
68 | * 获取sd卡路径
69 | *
70 | * @return Stringpath
71 | */
72 | public static String getSDPath() {
73 | File sdDir = null;
74 | boolean sdCardExist = Environment.getExternalStorageState()
75 | .equals(Environment.MEDIA_MOUNTED); //判断sd卡是否存在
76 | if (sdCardExist) {
77 | sdDir = Environment.getExternalStorageDirectory();//获取跟目录
78 | }
79 | return sdDir.toString();
80 | }
81 |
82 | /**
83 | * 获取空闲的空间大小
84 | * @param path 文件路径
85 | * @return 空间大小
86 | */
87 | public static long getFreeSpaceBytes(final String path) {
88 | long freeSpaceBytes;
89 | final StatFs statFs = new StatFs(path);
90 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
91 | freeSpaceBytes = statFs.getAvailableBytes();
92 | } else {
93 | //noinspection deprecation
94 | freeSpaceBytes = statFs.getAvailableBlocks() * (long) statFs.getBlockSize();
95 | }
96 |
97 | return freeSpaceBytes;
98 | }
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/playerview/src/main/java/com/dl7/player/utils/SoftInputUtils.java:
--------------------------------------------------------------------------------
1 | package com.dl7.player.utils;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.view.View;
6 | import android.view.inputmethod.InputMethodManager;
7 |
8 | /**
9 | * SoftInputUtils
10 | *
11 | * @author Trinea 2014-5-07
12 | */
13 | public class SoftInputUtils {
14 |
15 | private SoftInputUtils() {
16 | throw new AssertionError();
17 | }
18 |
19 |
20 | /**
21 | * 关闭键盘事件.
22 | *
23 | * @param context the context
24 | */
25 | public static void closeSoftInput(Context context) {
26 | InputMethodManager inputMethodManager = (InputMethodManager) context
27 | .getSystemService(Context.INPUT_METHOD_SERVICE);
28 | if (inputMethodManager != null
29 | && ((Activity) context).getCurrentFocus() != null) {
30 | inputMethodManager.hideSoftInputFromWindow(((Activity) context)
31 | .getCurrentFocus().getWindowToken(),
32 | InputMethodManager.HIDE_NOT_ALWAYS);
33 | }
34 | }
35 |
36 | /**
37 | * 弹出输入法
38 | *
39 | * @param context context
40 | * @param view 编辑控件
41 | */
42 | public static void setEditFocusable(final Context context, final View view) {
43 | view.setFocusableInTouchMode(true);
44 | view.requestFocus();
45 | InputMethodManager inputMethodManager = (InputMethodManager) context
46 | .getSystemService(Context.INPUT_METHOD_SERVICE);
47 | inputMethodManager.showSoftInput(view, 0);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/playerview/src/main/java/com/dl7/player/utils/StringUtils.java:
--------------------------------------------------------------------------------
1 | package com.dl7.player.utils;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 |
6 | /**
7 | * Created by long on 2016/10/18.
8 | */
9 |
10 | public final class StringUtils {
11 |
12 | private StringUtils() {
13 | throw new AssertionError();
14 | }
15 |
16 |
17 | /**
18 | * 时长格式化显示
19 | */
20 | public static String generateTime(long time) {
21 | int totalSeconds = (int) (time / 1000);
22 | int seconds = totalSeconds % 60;
23 | int minutes = totalSeconds / 60;
24 | // int minutes = (totalSeconds / 60) % 60;
25 | // int hours = totalSeconds / 3600;
26 | return minutes > 99 ? String.format("%d:%02d", minutes, seconds) : String.format("%02d:%02d", minutes, seconds);
27 | }
28 |
29 | /**
30 | * 下载速度格式化显示
31 | */
32 | public static String getFormatSize(int size) {
33 | long fileSize = (long) size;
34 | String showSize = "";
35 | if (fileSize >= 0 && fileSize < 1024) {
36 | showSize = fileSize + "Kb/s";
37 | } else if (fileSize >= 1024 && fileSize < (1024 * 1024)) {
38 | showSize = Long.toString(fileSize / 1024) + "KB/s";
39 | } else if (fileSize >= (1024 * 1024) && fileSize < (1024 * 1024 * 1024)) {
40 | showSize = Long.toString(fileSize / (1024 * 1024)) + "MB/s";
41 | }
42 | return showSize;
43 | }
44 |
45 | /**
46 | * 获取格式化当前时间
47 | * @return
48 | */
49 | public static String getCurFormatTime() {
50 | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
51 | return sdf.format(new Date(System.currentTimeMillis()));
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/playerview/src/main/java/com/dl7/player/utils/WindowUtils.java:
--------------------------------------------------------------------------------
1 | package com.dl7.player.utils; /**
2 | * Copyright 2014 Zhenguo Jin (jinzhenguo1990@gmail.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import android.animation.ValueAnimator;
18 | import android.app.Activity;
19 | import android.content.Context;
20 | import android.content.pm.ActivityInfo;
21 | import android.content.res.Configuration;
22 | import android.util.DisplayMetrics;
23 | import android.view.Surface;
24 | import android.view.Window;
25 | import android.view.WindowManager;
26 |
27 | /**
28 | * 窗口工具箱
29 | *
30 | * @author zhenguo
31 | */
32 | public final class WindowUtils {
33 |
34 | /**
35 | * Don't let anyone instantiate this class.
36 | */
37 | private WindowUtils() {
38 | throw new Error("Do not need instantiate!");
39 | }
40 |
41 | /**
42 | * 获取当前窗口的旋转角度
43 | *
44 | * @param activity activity
45 | * @return int
46 | */
47 | public static int getDisplayRotation(Activity activity) {
48 | switch (activity.getWindowManager().getDefaultDisplay().getRotation()) {
49 | case Surface.ROTATION_0:
50 | return 0;
51 | case Surface.ROTATION_90:
52 | return 90;
53 | case Surface.ROTATION_180:
54 | return 180;
55 | case Surface.ROTATION_270:
56 | return 270;
57 | default:
58 | return 0;
59 | }
60 | }
61 |
62 | /**
63 | * 当前是否是横屏
64 | *
65 | * @param context context
66 | * @return boolean
67 | */
68 | public static final boolean isLandscape(Context context) {
69 | return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
70 | }
71 |
72 | /**
73 | * 当前是否是竖屏
74 | *
75 | * @param context context
76 | * @return boolean
77 | */
78 | public static final boolean isPortrait(Context context) {
79 | return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
80 | }
81 |
82 | /**
83 | * 调整窗口的透明度 1.0f,0.5f 变暗
84 | *
85 | * @param from from>=0&&from<=1.0f
86 | * @param to to>=0&&to<=1.0f
87 | * @param context 当前的activity
88 | */
89 | public static void dimBackground(final float from, final float to, Activity context) {
90 | final Window window = context.getWindow();
91 | ValueAnimator valueAnimator = ValueAnimator.ofFloat(from, to);
92 | valueAnimator.setDuration(500);
93 | valueAnimator.addUpdateListener(
94 | new ValueAnimator.AnimatorUpdateListener() {
95 | @Override
96 | public void onAnimationUpdate(ValueAnimator animation) {
97 | WindowManager.LayoutParams params
98 | = window.getAttributes();
99 | params.alpha = (Float) animation.getAnimatedValue();
100 | window.setAttributes(params);
101 | }
102 | });
103 | valueAnimator.start();
104 | }
105 |
106 | /**
107 | * 获取界面方向
108 | */
109 | public static int getScreenOrientation(Activity activity) {
110 | int rotation = activity.getWindowManager().getDefaultDisplay().getRotation();
111 | DisplayMetrics dm = new DisplayMetrics();
112 | activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
113 | int width = dm.widthPixels;
114 | int height = dm.heightPixels;
115 | int orientation;
116 | // if the device's natural orientation is portrait:
117 | if ((rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) && height > width ||
118 | (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) && width > height) {
119 | switch (rotation) {
120 | case Surface.ROTATION_0:
121 | orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
122 | break;
123 | case Surface.ROTATION_90:
124 | orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
125 | break;
126 | case Surface.ROTATION_180:
127 | orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
128 | break;
129 | case Surface.ROTATION_270:
130 | orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
131 | break;
132 | default:
133 | orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
134 | break;
135 | }
136 | }
137 | // if the device's natural orientation is landscape or if the device
138 | // is square:
139 | else {
140 | switch (rotation) {
141 | case Surface.ROTATION_0:
142 | orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
143 | break;
144 | case Surface.ROTATION_90:
145 | orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
146 | break;
147 | case Surface.ROTATION_180:
148 | orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
149 | break;
150 | case Surface.ROTATION_270:
151 | orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
152 | break;
153 | default:
154 | orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
155 | break;
156 | }
157 | }
158 |
159 | return orientation;
160 | }
161 | }
--------------------------------------------------------------------------------
/playerview/src/main/java/com/dl7/player/widgets/MarqueeTextView.java:
--------------------------------------------------------------------------------
1 | package com.dl7.player.widgets;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.TextView;
6 |
7 | /**
8 | * Created by Rukey7 on 2016/11/14.
9 | * 跑马灯TextView
10 | */
11 | public class MarqueeTextView extends TextView {
12 |
13 | public MarqueeTextView(Context context) {
14 | super(context);
15 | }
16 |
17 | public MarqueeTextView(Context context, AttributeSet attrs) {
18 | super(context, attrs);
19 | }
20 |
21 | public MarqueeTextView(Context context, AttributeSet attrs, int defStyleAttr) {
22 | super(context, attrs, defStyleAttr);
23 | }
24 |
25 | @Override
26 | public boolean isFocused() {
27 | return true;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/playerview/src/main/java/com/dl7/player/widgets/ShareDialog.java:
--------------------------------------------------------------------------------
1 | package com.dl7.player.widgets;
2 |
3 | import android.content.DialogInterface;
4 | import android.graphics.Bitmap;
5 | import android.graphics.Color;
6 | import android.graphics.drawable.ColorDrawable;
7 | import android.net.Uri;
8 | import android.os.Bundle;
9 | import android.support.annotation.Nullable;
10 | import android.support.v4.app.DialogFragment;
11 | import android.view.LayoutInflater;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 | import android.view.Window;
15 | import android.view.WindowManager;
16 | import android.widget.ImageView;
17 | import android.widget.TextView;
18 |
19 | import com.dl7.player.R;
20 |
21 | /**
22 | * Created by long on 2016/11/17.
23 | */
24 |
25 | public class ShareDialog extends DialogFragment {
26 |
27 | private OnDialogClickListener mClickListener;
28 | private OnDialogDismissListener mDismissListener;
29 | private Bitmap mBitmap;
30 | private boolean mIsShareMode = false;
31 |
32 | @Nullable
33 | @Override
34 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
35 | getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
36 | Window window = getDialog().getWindow();
37 | window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
38 | window.setWindowAnimations(R.style.AnimateDialog);
39 | window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
40 |
41 | View view = inflater.inflate(R.layout.dialog_share, container);
42 | final ImageView photo = (ImageView) view.findViewById(R.id.iv_screenshot_photo);
43 | ViewGroup.LayoutParams layoutParams = photo.getLayoutParams();
44 | layoutParams.width = getResources().getDisplayMetrics().widthPixels * 7 / 10;
45 | layoutParams.height = getResources().getDisplayMetrics().heightPixels * 7 / 10;
46 | photo.setLayoutParams(layoutParams);
47 | if (mBitmap != null) {
48 | photo.setImageBitmap(mBitmap);
49 | }
50 | view.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
51 | @Override
52 | public void onClick(View v) {
53 | dismiss();
54 | }
55 | });
56 | TextView tvShare = (TextView) view.findViewById(R.id.btn_share);
57 | if (mIsShareMode) {
58 | tvShare.setText("分享");
59 | }
60 | tvShare.setOnClickListener(new View.OnClickListener() {
61 | @Override
62 | public void onClick(View v) {
63 | if (mClickListener != null) {
64 | mClickListener.onShare(mBitmap, null);
65 | }
66 | dismiss();
67 | }
68 | });
69 | return view;
70 | }
71 |
72 | @Override
73 | public void dismiss() {
74 | super.dismiss();
75 | if (mDismissListener != null) {
76 | mDismissListener.onDismiss();
77 | }
78 | }
79 |
80 | @Override
81 | public void onCancel(DialogInterface dialog) {
82 | super.onCancel(dialog);
83 | // 点击外部回调这里
84 | if (mDismissListener != null) {
85 | mDismissListener.onDismiss();
86 | }
87 | }
88 |
89 | public void setScreenshotPhoto(Bitmap bitmap) {
90 | mBitmap = bitmap;
91 | }
92 |
93 | public void setClickListener(OnDialogClickListener clickListener) {
94 | mClickListener = clickListener;
95 | }
96 |
97 | public void setDismissListener(OnDialogDismissListener dismissListener) {
98 | mDismissListener = dismissListener;
99 | }
100 |
101 | public void setShareMode(boolean shareMode) {
102 | mIsShareMode = shareMode;
103 | }
104 |
105 | public interface OnDialogClickListener {
106 | void onShare(Bitmap bitmap, Uri uri);
107 | }
108 |
109 | public interface OnDialogDismissListener {
110 | void onDismiss();
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/playerview/src/main/res/anim/dialog_zoom_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
15 |
--------------------------------------------------------------------------------
/playerview/src/main/res/anim/dialog_zoom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/layer_battery_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | -
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/layer_seek_progress.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_ar_16_9.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_ar_4_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_ar_adjust_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_ar_adjust_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_danmaku_control.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_danmaku_input_options_bottom_type.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_danmaku_input_options_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_danmaku_input_options_medium_textsize.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_danmaku_input_options_rl_type.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_danmaku_input_options_small_textsize.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_danmaku_input_options_top_type.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_fullscreen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_play.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_share_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_btn_share_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_item_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_media_quality_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_media_quality_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/sel_player_lock.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/shape_dialog_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/shape_player_lock_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/shape_seek_ball.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/shape_selected_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/shape_send_danmaku_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/shape_video_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/playerview/src/main/res/drawable/transition_item_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/adapter_media_quality.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
18 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/dialog_share.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
21 |
22 |
26 |
27 |
35 |
36 |
40 |
41 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/layout_bottom_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
21 |
22 |
36 |
37 |
44 |
45 |
53 |
54 |
62 |
63 |
73 |
74 |
85 |
86 |
95 |
96 |
111 |
112 |
123 |
124 |
140 |
141 |
150 |
151 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/layout_media_quality.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
21 |
22 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/layout_player_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
26 |
27 |
36 |
37 |
42 |
43 |
45 |
46 |
48 |
49 |
59 |
60 |
61 |
62 |
68 |
69 |
75 |
76 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/layout_send_danmaku.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
19 |
20 |
30 |
31 |
41 |
42 |
50 |
51 |
52 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/layout_skip_tip.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
15 |
16 |
23 |
24 |
28 |
29 |
36 |
37 |
44 |
45 |
49 |
50 |
59 |
60 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/layout_top_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
22 |
23 |
38 |
39 |
44 |
45 |
52 |
53 |
60 |
61 |
73 |
74 |
75 |
81 |
82 |
89 |
90 |
91 |
102 |
103 |
107 |
108 |
112 |
113 |
117 |
118 |
122 |
123 |
--------------------------------------------------------------------------------
/playerview/src/main/res/layout/layout_touch_gestures.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
15 |
26 |
27 |
28 |
39 |
40 |
41 |
51 |
52 |
53 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_battery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_battery.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_battery_charging.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_battery_charging.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_battery_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_battery_red.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_brightness.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_cancel_danmaku.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_cancel_danmaku.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_cancel_skip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_cancel_skip.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_danmaku_closed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_danmaku_closed.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_danmaku_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_danmaku_open.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_fast_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_fast_forward.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_fast_rewind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_fast_rewind.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_fullscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_fullscreen.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_fullscreen_exit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_fullscreen_exit.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_media_quality_bd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_media_quality_bd.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_media_quality_high.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_media_quality_high.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_media_quality_medium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_media_quality_medium.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_media_quality_smooth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_media_quality_smooth.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_media_quality_super.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_media_quality_super.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_play_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_play_circle.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_player_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_player_lock.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_player_unlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_player_unlock.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_return_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_return_back.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_send_danmaku.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_send_danmaku.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_video_pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_video_pause.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_video_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_video_play.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_video_screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_video_screenshot.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_volume_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_volume_off.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-hdpi/ic_volume_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-hdpi/ic_volume_on.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_ar_16_9_inside.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_ar_16_9_inside.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_ar_16_9_inside_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_ar_16_9_inside_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_ar_4_3_inside.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_ar_4_3_inside.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_ar_4_3_inside_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_ar_4_3_inside_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_ar_adjust_screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_ar_adjust_screen.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_ar_adjust_screen_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_ar_adjust_screen_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_ar_adjust_video.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_ar_adjust_video.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_ar_adjust_video_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_ar_adjust_video_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_brightness.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_btn_danmaku_input_options_color_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_btn_danmaku_input_options_color_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_cancel_danmaku.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_cancel_danmaku.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_cancel_skip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_cancel_skip.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_closed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_closed.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_more_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_more_color.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_bottom_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_bottom_type.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_bottom_type_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_bottom_type_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_medium_textsize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_medium_textsize.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_medium_textsize_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_medium_textsize_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_rl_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_rl_type.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_rl_type_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_rl_type_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_small_textsize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_small_textsize.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_small_textsize_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_small_textsize_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_top_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_top_type.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_top_type_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_input_options_top_type_checked.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_danmaku_open.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_fast_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_fast_forward.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_fast_rewind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_fast_rewind.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_fullscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_fullscreen.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_fullscreen_exit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_fullscreen_exit.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_bd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_bd.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_high.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_high.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_medium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_medium.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_smooth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_smooth.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_super.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_media_quality_super.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_play_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_play_circle.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_player_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_player_lock.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_player_unlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_player_unlock.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_reload.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_return_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_return_back.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_send_danmaku.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_send_danmaku.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_video_pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_video_pause.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_video_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_video_play.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_video_screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_video_screenshot.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_volume_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_volume_off.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xhdpi/ic_volume_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xhdpi/ic_volume_on.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_brightness.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_cancel_danmaku.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_cancel_danmaku.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_cancel_skip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_cancel_skip.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_danmaku_closed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_danmaku_closed.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_danmaku_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_danmaku_open.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_fast_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_fast_forward.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_fast_rewind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_fast_rewind.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_fullscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_fullscreen.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_fullscreen_exit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_fullscreen_exit.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_bd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_bd.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_high.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_high.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_medium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_medium.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_smooth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_smooth.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_super.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_media_quality_super.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_play_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_play_circle.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_player_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_player_lock.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_player_unlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_player_unlock.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_return_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_return_back.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_send_danmaku.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_send_danmaku.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_video_pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_video_pause.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_video_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_video_play.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_video_screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_video_screenshot.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_volume_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_volume_off.png
--------------------------------------------------------------------------------
/playerview/src/main/res/mipmap-xxhdpi/ic_volume_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/playerview/src/main/res/mipmap-xxhdpi/ic_volume_on.png
--------------------------------------------------------------------------------
/playerview/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #80000000
6 |
7 | #809e9e9e
8 | #cce91e63
9 | #88f48fb1
10 | #ffffffff
11 |
12 | #ccec407a
13 | #e91e63
14 |
15 | #55ffffff
16 | #ffffff
17 |
18 | #ffa5a5a5
19 | #ffbababa
20 |
21 | #f06292
22 |
23 |
--------------------------------------------------------------------------------
/playerview/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 46dp
5 | 48dp
6 | 32.0dip
7 | 25.0dip
8 | 5.0dip
9 | 42.0dip
10 |
11 | 44dp
12 | 20dp
13 | 30dp
14 |
--------------------------------------------------------------------------------
/playerview/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - false
5 | - false
6 | - false
7 | - false
8 | - false
9 | - false
10 | - false
11 | - false
12 | - false
13 | - false
14 | - false
15 | - false
16 | - false
17 | - false
18 | - false
19 | - false
20 | - false
21 | - false
22 | - false
23 | - false
24 | - false
25 | - false
26 | - false
27 | - false
28 |
29 | - false
30 |
--------------------------------------------------------------------------------
/playerview/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | PlayerView
3 | 记忆上次播放到
4 | 继续播放
5 |
6 |
7 | - 流畅
8 | - 清晰
9 | - 高清
10 | - 超清
11 | - 1080P
12 |
13 |
14 |
--------------------------------------------------------------------------------
/playerview/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
17 |
18 |
19 |
28 |
29 |
30 |
37 |
38 |
39 |
45 |
46 |
47 |
51 |
--------------------------------------------------------------------------------
/playerview/src/test/java/com/dl7/player/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.dl7.player;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.2"
6 |
7 | defaultConfig {
8 | applicationId "com.dl7.player"
9 | minSdkVersion 15
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(include: ['*.jar'], dir: 'libs')
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.0'
31 | compile 'com.android.support:design:24.2.0'
32 | compile 'com.android.support:cardview-v7:24.2.0'
33 | testCompile 'junit:junit:4.12'
34 | compile project(':playerview')
35 | compile 'com.github.bumptech.glide:glide:3.7.0'
36 | compile 'com.google.code.gson:gson:2.2.4'
37 | // TagLayout
38 | compile 'com.github.Rukey7:TagLayout:1.0.3'
39 | }
40 |
--------------------------------------------------------------------------------
/sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in F:\WorkTools\Android\SDK/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/sample/src/androidTest/java/com/dl7/playerdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.dl7.nativeplayer", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
17 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
30 |
31 |
32 |
33 |
36 |
37 |
41 |
42 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/IjkFullscreenActivity.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.view.KeyEvent;
6 |
7 | import com.bumptech.glide.Glide;
8 | import com.dl7.player.media.IjkPlayerView;
9 |
10 | public class IjkFullscreenActivity extends AppCompatActivity {
11 |
12 | private static final String VIDEO_URL = "http://flv2.bn.netease.com/videolib3/1611/28/nNTov5571/SD/nNTov5571-mobile.mp4";
13 | private static final String IMAGE_URL = "http://vimg3.ws.126.net/image/snapshot/2016/11/C/T/VC628QHCT.jpg";
14 | IjkPlayerView mPlayerView;
15 |
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | mPlayerView = new IjkPlayerView(this);
20 | setContentView(mPlayerView);
21 | Glide.with(this).load(IMAGE_URL).fitCenter().into(mPlayerView.mPlayerThumb);
22 | mPlayerView.init()
23 | .alwaysFullScreen()
24 | .enableOrientation()
25 | .setVideoPath(VIDEO_URL)
26 | .enableDanmaku()
27 | .setDanmakuSource(getResources().openRawResource(R.raw.bili))
28 | .setTitle("这是个跑马灯TextView,标题要足够长才会跑。-(゜ -゜)つロ 乾杯~")
29 | .start();
30 | }
31 |
32 | @Override
33 | protected void onResume() {
34 | super.onResume();
35 | mPlayerView.onResume();
36 | }
37 |
38 | @Override
39 | protected void onPause() {
40 | super.onPause();
41 | mPlayerView.onPause();
42 | }
43 |
44 | @Override
45 | protected void onDestroy() {
46 | super.onDestroy();
47 | mPlayerView.onDestroy();
48 | }
49 |
50 | @Override
51 | public boolean onKeyDown(int keyCode, KeyEvent event) {
52 | if (mPlayerView.handleVolumeKey(keyCode)) {
53 | return true;
54 | }
55 | return super.onKeyDown(keyCode, event);
56 | }
57 |
58 | @Override
59 | public void onBackPressed() {
60 | if (mPlayerView.onBackPressed()) {
61 | return;
62 | }
63 | super.onBackPressed();
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/IjkPlayerActivity.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo;
2 |
3 | import android.content.res.Configuration;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.support.v7.widget.Toolbar;
7 | import android.view.KeyEvent;
8 | import android.view.MotionEvent;
9 | import android.view.View;
10 | import android.widget.Button;
11 | import android.widget.EditText;
12 |
13 | import com.bumptech.glide.Glide;
14 | import com.dl7.player.media.IjkPlayerView;
15 | import com.dl7.player.utils.SoftInputUtils;
16 |
17 | public class IjkPlayerActivity extends AppCompatActivity {
18 |
19 | private static final String VIDEO_URL = "http://flv2.bn.netease.com/videolib3/1611/28/GbgsL3639/SD/movie_index.m3u8";
20 | private static final String VIDEO_HD_URL = "http://flv2.bn.netease.com/videolib3/1611/28/GbgsL3639/HD/movie_index.m3u8";
21 | private static final String IMAGE_URL = "http://vimg2.ws.126.net/image/snapshot/2016/11/I/M/VC62HMUIM.jpg";
22 |
23 | Toolbar mToolbar;
24 | private IjkPlayerView mPlayerView;
25 | private View mEtLayout;
26 | private EditText mEditText;
27 | private Button mIvSend;
28 | private boolean mIsFocus;
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.activity_ijk_player);
34 | mToolbar = (Toolbar) findViewById(R.id.toolbar);
35 | mPlayerView = (IjkPlayerView) findViewById(R.id.player_view);
36 | mEtLayout = findViewById(R.id.ll_layout);
37 | mEditText = (EditText) findViewById(R.id.et_content);
38 | mIvSend = (Button) findViewById(R.id.btn_send);
39 | setSupportActionBar(mToolbar);
40 | mToolbar.setTitle("Video Player");
41 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
42 |
43 | Glide.with(this).load(IMAGE_URL).fitCenter().into(mPlayerView.mPlayerThumb);
44 | mPlayerView.init()
45 | .setTitle("这是个跑马灯TextView,标题要足够长才会跑。-(゜ -゜)つロ 乾杯~")
46 | .setSkipTip(1000*60*1)
47 | .enableDanmaku()
48 | .setDanmakuSource(getResources().openRawResource(R.raw.bili))
49 | .setVideoSource(null, VIDEO_URL, VIDEO_HD_URL, null, null)
50 | .setMediaQuality(IjkPlayerView.MEDIA_QUALITY_HIGH);
51 |
52 | mIvSend.setOnClickListener(new View.OnClickListener() {
53 | @Override
54 | public void onClick(View v) {
55 | mPlayerView.sendDanmaku(mEditText.getText().toString(), false);
56 | mEditText.setText("");
57 | _closeSoftInput();
58 | }
59 | });
60 | mEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
61 | @Override
62 | public void onFocusChange(View view, boolean isFocus) {
63 | if (isFocus) {
64 | mPlayerView.editVideo();
65 | }
66 | mIsFocus = isFocus;
67 | }
68 | });
69 | }
70 |
71 | @Override
72 | protected void onResume() {
73 | super.onResume();
74 | mPlayerView.onResume();
75 | }
76 |
77 | @Override
78 | protected void onPause() {
79 | super.onPause();
80 | mPlayerView.onPause();
81 | }
82 |
83 | @Override
84 | protected void onDestroy() {
85 | super.onDestroy();
86 | mPlayerView.onDestroy();
87 | }
88 |
89 | @Override
90 | public void onConfigurationChanged(Configuration newConfig) {
91 | super.onConfigurationChanged(newConfig);
92 | mPlayerView.configurationChanged(newConfig);
93 | }
94 |
95 | @Override
96 | public boolean onKeyDown(int keyCode, KeyEvent event) {
97 | if (mPlayerView.handleVolumeKey(keyCode)) {
98 | return true;
99 | }
100 | return super.onKeyDown(keyCode, event);
101 | }
102 |
103 | @Override
104 | public void onBackPressed() {
105 | if (mPlayerView.onBackPressed()) {
106 | return;
107 | }
108 | super.onBackPressed();
109 | }
110 |
111 |
112 |
113 | @Override
114 | public boolean dispatchTouchEvent(MotionEvent ev) {
115 | View view = getCurrentFocus();
116 | if (_isHideSoftInput(view, (int) ev.getX(), (int) ev.getY())) {
117 | _closeSoftInput();
118 | return true;
119 | }
120 | return super.dispatchTouchEvent(ev);
121 | }
122 |
123 | private void _closeSoftInput() {
124 | mEditText.clearFocus();
125 | SoftInputUtils.closeSoftInput(this);
126 | mPlayerView.recoverFromEditVideo();
127 | }
128 |
129 | private boolean _isHideSoftInput(View view, int x, int y) {
130 | if (view == null || !(view instanceof EditText) || !mIsFocus) {
131 | return false;
132 | }
133 | return x < mEtLayout.getLeft() ||
134 | x > mEtLayout.getRight() ||
135 | y < mEtLayout.getTop();
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | public class MainActivity extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_main);
14 |
15 | findViewById(R.id.btn_video).setOnClickListener(new View.OnClickListener() {
16 | @Override
17 | public void onClick(View v) {
18 | startActivity(new Intent(MainActivity.this, IjkPlayerActivity.class));
19 | }
20 | });
21 | findViewById(R.id.btn_fullscreen_video).setOnClickListener(new View.OnClickListener() {
22 | @Override
23 | public void onClick(View v) {
24 | startActivity(new Intent(MainActivity.this, IjkFullscreenActivity.class));
25 | }
26 | });
27 | findViewById(R.id.btn_test_aspect).setOnClickListener(new View.OnClickListener() {
28 | @Override
29 | public void onClick(View v) {
30 | startActivity(new Intent(MainActivity.this, TestAspectActivity.class));
31 | }
32 | });
33 | findViewById(R.id.btn_custom_danmaku).setOnClickListener(new View.OnClickListener() {
34 | @Override
35 | public void onClick(View v) {
36 | startActivity(new Intent(MainActivity.this, CustomDanmakuActivity.class));
37 | }
38 | });
39 | findViewById(R.id.btn_switch_video).setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View v) {
42 | startActivity(new Intent(MainActivity.this, SwitchVideoActivity.class));
43 | }
44 | });
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/SwitchVideoActivity.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo;
2 |
3 | import android.content.res.Configuration;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.KeyEvent;
7 |
8 | import com.bumptech.glide.Glide;
9 | import com.dl7.player.media.IjkPlayerView;
10 | import com.dl7.tag.TagLayout;
11 | import com.dl7.tag.TagView;
12 |
13 | import tv.danmaku.ijk.media.player.IMediaPlayer;
14 |
15 | public class SwitchVideoActivity extends AppCompatActivity {
16 |
17 | private static final String IMAGE_URL = "http://vimg3.ws.126.net/image/snapshot/2015/5/J/M/VAPRJCSJM.jpg";
18 |
19 | private final String[] mVideoPath = new String[]{
20 | "http://flv2.bn.netease.com/videolib3/1505/29/DCNOo7461/SD/DCNOo7461-mobile.mp4",
21 | "http://flv2.bn.netease.com/videolib3/1611/28/nNTov5571/SD/nNTov5571-mobile.mp4",
22 | "http://flv2.bn.netease.com/videolib3/1611/28/GbgsL3639/SD/movie_index.m3u8",
23 | };
24 | private final String[] mTitle = new String[]{
25 | "视频1", "视频2", "视频3",
26 | };
27 |
28 | private IjkPlayerView mPlayerView;
29 | private TagLayout mTagLayout;
30 | private int mIndex = 0;
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_switch_video);
36 | mPlayerView = (IjkPlayerView) findViewById(R.id.player_view);
37 | mTagLayout = (TagLayout) findViewById(R.id.tag_layout);
38 |
39 | Glide.with(this).load(IMAGE_URL).fitCenter().into(mPlayerView.mPlayerThumb);
40 | mPlayerView.init()
41 | .setTitle(mTitle[mIndex])
42 | .enableDanmaku()
43 | .setDanmakuSource(getResources().openRawResource(R.raw.bili))
44 | .setVideoPath(mVideoPath[mIndex]);
45 |
46 | mPlayerView.setOnCompletionListener(new IMediaPlayer.OnCompletionListener() {
47 | @Override
48 | public void onCompletion(IMediaPlayer iMediaPlayer) {
49 | mIndex++;
50 | if (mIndex != mTitle.length) {
51 | mPlayerView.switchVideoPath(mVideoPath[mIndex])
52 | .setTitle(mTitle[mIndex])
53 | .enableDanmaku(false)
54 | .start();
55 | mTagLayout.setCheckTag(mIndex);
56 | }
57 | }
58 | });
59 |
60 | mTagLayout.setTags(mTitle);
61 | mTagLayout.setCheckTag(0);
62 | mTagLayout.setTagCheckListener(new TagView.OnTagCheckListener() {
63 | @Override
64 | public void onTagCheck(int i, String s, boolean isCheck) {
65 | if (isCheck && mIndex != i) {
66 | mIndex = i;
67 | mPlayerView.switchVideoPath(mVideoPath[mIndex])
68 | .setTitle(mTitle[mIndex])
69 | .enableDanmaku()
70 | .setDanmakuSource(getResources().openRawResource(R.raw.bili))
71 | .start();
72 | }
73 | }
74 | });
75 | }
76 |
77 | @Override
78 | protected void onResume() {
79 | super.onResume();
80 | mPlayerView.onResume();
81 | }
82 |
83 | @Override
84 | protected void onPause() {
85 | super.onPause();
86 | mPlayerView.onPause();
87 | }
88 |
89 | @Override
90 | protected void onDestroy() {
91 | super.onDestroy();
92 | mPlayerView.onDestroy();
93 | }
94 |
95 | @Override
96 | public void onConfigurationChanged(Configuration newConfig) {
97 | super.onConfigurationChanged(newConfig);
98 | mPlayerView.configurationChanged(newConfig);
99 | }
100 |
101 | @Override
102 | public boolean onKeyDown(int keyCode, KeyEvent event) {
103 | if (mPlayerView.handleVolumeKey(keyCode)) {
104 | return true;
105 | }
106 | return super.onKeyDown(keyCode, event);
107 | }
108 |
109 | @Override
110 | public void onBackPressed() {
111 | if (mPlayerView.onBackPressed()) {
112 | return;
113 | }
114 | super.onBackPressed();
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/TestAspectActivity.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo;
2 |
3 | import android.content.res.Configuration;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.KeyEvent;
7 | import android.widget.ListView;
8 |
9 | import com.bumptech.glide.Glide;
10 | import com.dl7.player.media.IjkPlayerView;
11 | import com.dl7.playerdemo.adapter.ListAdapter;
12 |
13 | import java.util.ArrayList;
14 | import java.util.List;
15 |
16 | public class TestAspectActivity extends AppCompatActivity {
17 |
18 | private static final String VIDEO_URL = "http://flv2.bn.netease.com/videolib3/1505/29/DCNOo7461/SD/DCNOo7461-mobile.mp4";
19 | private static final String IMAGE_URL = "http://vimg3.ws.126.net/image/snapshot/2015/5/J/M/VAPRJCSJM.jpg";
20 |
21 | private IjkPlayerView mPlayerView;
22 | private ListView mListView;
23 | private ListAdapter mAdapter;
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.activity_test_aspect);
29 | mPlayerView = (IjkPlayerView) findViewById(R.id.player_view);
30 | mListView = (ListView) findViewById(R.id.lv_list);
31 |
32 | List list = new ArrayList<>();
33 | for (int i = 0; i < 40; i++) {
34 | list.add("Some message " + i);
35 | }
36 | mAdapter = new ListAdapter(this, list);
37 | mListView.setAdapter(mAdapter);
38 |
39 | Glide.with(this).load(IMAGE_URL).fitCenter().into(mPlayerView.mPlayerThumb);
40 | mPlayerView.init()
41 | .setTitle("美加州死亡谷石头会走路")
42 | .setVideoPath(VIDEO_URL);
43 | }
44 |
45 | @Override
46 | protected void onResume() {
47 | super.onResume();
48 | mPlayerView.onResume();
49 | }
50 |
51 | @Override
52 | protected void onPause() {
53 | super.onPause();
54 | mPlayerView.onPause();
55 | }
56 |
57 | @Override
58 | protected void onDestroy() {
59 | super.onDestroy();
60 | mPlayerView.onDestroy();
61 | }
62 |
63 | @Override
64 | public void onConfigurationChanged(Configuration newConfig) {
65 | super.onConfigurationChanged(newConfig);
66 | mPlayerView.configurationChanged(newConfig);
67 | }
68 |
69 | @Override
70 | public boolean onKeyDown(int keyCode, KeyEvent event) {
71 | if (mPlayerView.handleVolumeKey(keyCode)) {
72 | return true;
73 | }
74 | return super.onKeyDown(keyCode, event);
75 | }
76 |
77 | @Override
78 | public void onBackPressed() {
79 | if (mPlayerView.onBackPressed()) {
80 | return;
81 | }
82 | super.onBackPressed();
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/adapter/BaseListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.adapter;
2 |
3 | import android.content.Context;
4 | import android.widget.BaseAdapter;
5 |
6 | import java.util.ArrayList;
7 | import java.util.Collections;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by long on 2016/6/7.
12 | * ListView的基础适配器
13 | */
14 | public abstract class BaseListAdapter extends BaseAdapter {
15 |
16 | protected Context mContext;
17 | protected List mDatas;
18 |
19 |
20 | public BaseListAdapter(Context context) {
21 | this.mContext = context;
22 | this.mDatas = new ArrayList<>();
23 | }
24 |
25 | public BaseListAdapter(Context context, List datas) {
26 | this.mContext = context;
27 | this.mDatas = datas;
28 | }
29 |
30 | public BaseListAdapter(Context context, T[] datas) {
31 | this.mContext = context;
32 | this.mDatas = new ArrayList();
33 | Collections.addAll(mDatas, datas);
34 | }
35 |
36 |
37 | @Override
38 | public int getCount() {
39 | return mDatas.size();
40 | }
41 |
42 | @Override
43 | public T getItem(int position) {
44 | return mDatas.get(position);
45 | }
46 |
47 | @Override
48 | public long getItemId(int position) {
49 | return position;
50 | }
51 |
52 |
53 |
54 | /**
55 | * 更新数据,替换原有数据
56 | * @param items
57 | */
58 | public void updateItems(List items) {
59 | mDatas = items;
60 | notifyDataSetChanged();
61 | }
62 |
63 | /**
64 | * 插入一条数据
65 | * @param item 数据
66 | */
67 | public void addItem(T item) {
68 | mDatas.add(0, item);
69 | notifyDataSetChanged();
70 | }
71 |
72 | /**
73 | * 插入一条数据
74 | * @param item 数据
75 | * @param position 插入位置
76 | */
77 | public void addItem(T item, int position) {
78 | position = Math.min(position, mDatas.size());
79 | mDatas.add(position, item);
80 | notifyDataSetChanged();
81 | }
82 |
83 | /**
84 | * 在列表尾添加一串数据
85 | * @param items
86 | */
87 | public void addItems(List items) {
88 | mDatas.addAll(items);
89 | }
90 |
91 | /**
92 | * 移除一条数据
93 | * @param position 位置
94 | */
95 | public void removeItem(int position) {
96 | if (position > mDatas.size() - 1) {
97 | return;
98 | }
99 | mDatas.remove(position);
100 | notifyDataSetChanged();
101 | }
102 |
103 | /**
104 | * 移除一条数据
105 | * @param item 数据
106 | */
107 | public void removeItem(T item) {
108 | int pos = 0;
109 | for (T info : mDatas) {
110 | if (item.hashCode() == info.hashCode()) {
111 | removeItem(pos);
112 | break;
113 | }
114 | pos++;
115 | }
116 | }
117 |
118 | /**
119 | * 清除所有数据
120 | */
121 | public void cleanItems() {
122 | mDatas.clear();
123 | notifyDataSetChanged();
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/adapter/ListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 |
9 | import com.dl7.playerdemo.R;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * Created by Rukey7 on 2016/11/27.
15 | */
16 |
17 | public class ListAdapter extends BaseListAdapter {
18 |
19 | public ListAdapter(Context context) {
20 | super(context);
21 | }
22 |
23 | public ListAdapter(Context context, List datas) {
24 | super(context, datas);
25 | }
26 |
27 | @Override
28 | public View getView(int i, View view, ViewGroup viewGroup) {
29 | if (view == null) {
30 | view = LayoutInflater.from(mContext).inflate(R.layout.adapter_list, viewGroup, false);
31 | }
32 | TextView tvContent = (TextView) view.findViewById(R.id.tv_content);
33 | tvContent.setText(mDatas.get(i));
34 | return view;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/danmaku/DanmakuConverter.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.danmaku;
2 |
3 | import com.dl7.player.danmaku.BaseDanmakuConverter;
4 |
5 | import master.flame.danmaku.danmaku.model.BaseDanmaku;
6 |
7 | /**
8 | * Created by long on 2016/12/22.
9 | * 弹幕数据转换器
10 | */
11 | public class DanmakuConverter extends BaseDanmakuConverter {
12 |
13 | private DanmakuConverter(){}
14 | private static volatile DanmakuConverter instance;
15 |
16 | public static DanmakuConverter instance() {
17 | if(instance == null){
18 | synchronized (DanmakuConverter.class){
19 | if(instance == null)
20 | instance = new DanmakuConverter();
21 | }
22 | }
23 | return instance;
24 | }
25 |
26 | @Override
27 | public DanmakuData convertDanmaku(BaseDanmaku danmaku) {
28 | DanmakuData data = new DanmakuData();
29 | // 弹幕基础数据初始化,重要!记得调用
30 | initData(data, danmaku);
31 | return data;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/danmaku/DanmakuData.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.danmaku;
2 |
3 | import com.dl7.player.danmaku.BaseDanmakuData;
4 |
5 | /**
6 | * Created by long on 2016/12/22.
7 | * 自定义弹幕数据
8 | */
9 | public class DanmakuData extends BaseDanmakuData {
10 |
11 | // 用户名
12 | public String userName;
13 | // 用户等级
14 | public int userLevel;
15 |
16 | @Override
17 | public String toString() {
18 | return "DanmakuData{" +
19 | "userName='" + userName + '\'' +
20 | ", userLevel=" + userLevel +
21 | "} " + super.toString();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/danmaku/DanmakuLoader.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.danmaku;
2 |
3 | import android.net.Uri;
4 |
5 | import java.io.InputStream;
6 |
7 | import master.flame.danmaku.danmaku.loader.ILoader;
8 | import master.flame.danmaku.danmaku.loader.IllegalDataException;
9 |
10 | /**
11 | * Created by long on 2016/12/22.
12 | * 自定义弹幕加载器,参考A站
13 | */
14 | public class DanmakuLoader implements ILoader {
15 |
16 | private DanmakuLoader(){}
17 | private static volatile DanmakuLoader instance;
18 | private JsonStrSource dataSource;
19 |
20 | public static ILoader instance() {
21 | if(instance == null){
22 | synchronized (DanmakuLoader.class){
23 | if(instance == null)
24 | instance = new DanmakuLoader();
25 | }
26 | }
27 | return instance;
28 | }
29 |
30 | @Override
31 | public JsonStrSource getDataSource() {
32 | return dataSource;
33 | }
34 |
35 | @Override
36 | public void load(String uri) throws IllegalDataException {
37 | try {
38 | dataSource = new JsonStrSource(Uri.parse(uri));
39 | } catch (Exception e) {
40 | throw new IllegalDataException(e);
41 | }
42 | }
43 |
44 | @Override
45 | public void load(InputStream in) throws IllegalDataException {
46 | try {
47 | dataSource = new JsonStrSource(in);
48 | } catch (Exception e) {
49 | throw new IllegalDataException(e);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/danmaku/DanmakuParser.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.danmaku;
2 |
3 | import android.graphics.Color;
4 | import android.text.TextUtils;
5 |
6 | import com.dl7.playerdemo.utils.GsonHelper;
7 |
8 | import java.util.List;
9 |
10 | import master.flame.danmaku.danmaku.model.BaseDanmaku;
11 | import master.flame.danmaku.danmaku.model.IDanmakus;
12 | import master.flame.danmaku.danmaku.model.android.Danmakus;
13 | import master.flame.danmaku.danmaku.parser.BaseDanmakuParser;
14 | import master.flame.danmaku.danmaku.util.DanmakuUtils;
15 |
16 | import static android.R.attr.textColor;
17 |
18 | /**
19 | * Created by long on 2016/12/22.
20 | * 自定义弹幕解析器,参考A站
21 | */
22 | public class DanmakuParser extends BaseDanmakuParser {
23 |
24 | @Override
25 | protected IDanmakus parse() {
26 | if (mDataSource != null && mDataSource instanceof JsonStrSource) {
27 | JsonStrSource jsonSource = (JsonStrSource) mDataSource;
28 | return doParse(jsonSource.data());
29 | }
30 | return new Danmakus();
31 | }
32 |
33 | /**
34 | * @param jsonStr 弹幕数据
35 | * @return 转换后的Danmakus
36 | */
37 | private Danmakus doParse(String jsonStr) {
38 | Danmakus danmakus = new Danmakus();
39 | if (TextUtils.isEmpty(jsonStr)) {
40 | return danmakus;
41 | }
42 | try {
43 | List datas = GsonHelper.convertEntities(jsonStr, DanmakuData.class);
44 | int size = datas.size();
45 | for (int i = 0; i < size; i++) {
46 | BaseDanmaku item = mContext.mDanmakuFactory.createDanmaku(datas.get(i).getType(), mContext);
47 | if (item != null) {
48 | item.setTime(datas.get(i).getTime());
49 | item.textSize = datas.get(i).getTextSize();
50 | item.textColor = datas.get(i).getTextColor();
51 | item.textShadowColor = textColor <= Color.BLACK ? Color.WHITE : Color.BLACK;
52 | DanmakuUtils.fillText(item, datas.get(i).getContent());
53 | item.index = i;
54 | item.setTimer(mTimer);
55 | danmakus.addItem(item);
56 | }
57 | }
58 | } catch (Exception e) {
59 | e.printStackTrace();
60 | }
61 |
62 | return danmakus;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/danmaku/JsonStrSource.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.danmaku;
2 |
3 | import android.net.Uri;
4 | import android.text.TextUtils;
5 |
6 | import org.json.JSONException;
7 |
8 | import java.io.File;
9 | import java.io.FileInputStream;
10 | import java.io.FileNotFoundException;
11 | import java.io.IOException;
12 | import java.io.InputStream;
13 | import java.net.URL;
14 |
15 | import master.flame.danmaku.danmaku.parser.IDataSource;
16 | import master.flame.danmaku.danmaku.util.IOUtils;
17 |
18 | /**
19 | * Created by long on 2016/12/22.
20 | * 自定义弹幕数据源,参考A站
21 | */
22 | public class JsonStrSource implements IDataSource {
23 |
24 | private String mJsonStr;
25 | private InputStream mInput;
26 | public JsonStrSource(String json) throws JSONException{
27 | init(json);
28 | }
29 |
30 | public JsonStrSource(InputStream in) throws JSONException{
31 | init(in);
32 | }
33 |
34 | private void init(InputStream in) throws JSONException {
35 | if(in == null)
36 | throw new NullPointerException("input stream cannot be null!");
37 | mInput = in;
38 | String json = IOUtils.getString(mInput);
39 | init(json);
40 | }
41 |
42 | public JsonStrSource(URL url) throws JSONException, IOException {
43 | this(url.openStream());
44 | }
45 |
46 | public JsonStrSource(File file) throws FileNotFoundException, JSONException{
47 | init(new FileInputStream(file));
48 | }
49 |
50 | public JsonStrSource(Uri uri) throws IOException, JSONException {
51 | String scheme = uri.getScheme();
52 | if (SCHEME_HTTP_TAG.equalsIgnoreCase(scheme) || SCHEME_HTTPS_TAG.equalsIgnoreCase(scheme)) {
53 | init(new URL(uri.getPath()).openStream());
54 | } else if (SCHEME_FILE_TAG.equalsIgnoreCase(scheme)) {
55 | init(new FileInputStream(uri.getPath()));
56 | }
57 | }
58 |
59 | private void init(String json) throws JSONException {
60 | if(!TextUtils.isEmpty(json)){
61 | mJsonStr = json;
62 | }
63 | }
64 |
65 | @Override
66 | public String data(){
67 | return mJsonStr;
68 | }
69 |
70 | @Override
71 | public void release() {
72 | IOUtils.closeQuietly(mInput);
73 | mInput = null;
74 | mJsonStr = null;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/utils/AfunData.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.utils;
2 |
3 | /**
4 | * Created by long on 2016/12/22.
5 | */
6 |
7 | public class AfunData {
8 |
9 | /**
10 | * c : 0,16777215,1,25,196050,1364468342
11 | * m : 。。。。。。。。。。。。。。。。。。。。。。
12 | */
13 |
14 | private String c;
15 | private String m;
16 |
17 | public String getC() {
18 | return c;
19 | }
20 |
21 | public void setC(String c) {
22 | this.c = c;
23 | }
24 |
25 | public String getM() {
26 | return m;
27 | }
28 |
29 | public void setM(String m) {
30 | this.m = m;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/utils/AssetsHelper.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.utils;
2 |
3 | import android.content.Context;
4 |
5 | import java.io.IOException;
6 | import java.io.InputStream;
7 |
8 | /**
9 | * Created by long on 2016/6/28.
10 | * Assets帮助类,测试用
11 | */
12 | public class AssetsHelper {
13 |
14 | private AssetsHelper() {
15 | }
16 |
17 |
18 | public static String readData(Context context, String fileName) {
19 | InputStream inStream = null;
20 | String data = null;
21 | try {
22 | inStream = context.getAssets().open(fileName); //打开assets目录中的文本文件
23 | byte[] bytes = new byte[inStream.available()]; //inStream.available()为文件中的总byte数
24 | inStream.read(bytes);
25 | inStream.close();
26 | data = new String(bytes, "utf-8"); //将bytes转为utf-8字符串
27 | } catch (IOException e) {
28 | e.printStackTrace();
29 | }
30 | return data;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/dl7/playerdemo/utils/GsonHelper.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo.utils;
2 |
3 | import com.google.gson.Gson;
4 | import com.google.gson.JsonArray;
5 | import com.google.gson.JsonElement;
6 | import com.google.gson.JsonParser;
7 | import com.google.gson.JsonSyntaxException;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by long on 2016/5/9.
14 | * Gson数据转化处理
15 | */
16 | public final class GsonHelper {
17 |
18 | private static Gson sGson = new Gson();
19 | private static JsonParser sJsonParser = new JsonParser();
20 |
21 |
22 | /**
23 | * 将json数据转化为实体数据
24 | * @param jsonData json字符串
25 | * @param entityClass 类型
26 | * @return 实体
27 | */
28 | public static T convertEntity(String jsonData, Class entityClass) {
29 | T entity = null;
30 | try {
31 | entity = sGson.fromJson(jsonData, entityClass);
32 | } catch (JsonSyntaxException e) {
33 | e.printStackTrace();
34 | }
35 | return entity;
36 | }
37 |
38 | /**
39 | * 将json数据转化为实体列表数据
40 | * @param jsonData json字符串
41 | * @param entityClass 类型
42 | * @return 实体列表
43 | */
44 | public static List convertEntities(String jsonData, Class entityClass) {
45 | List entities = new ArrayList<>();
46 | try {
47 | JsonArray jsonArray = sJsonParser.parse(jsonData).getAsJsonArray();
48 | for (JsonElement element : jsonArray) {
49 | entities.add(sGson.fromJson(element, entityClass));
50 | }
51 | } catch (JsonSyntaxException e) {
52 | e.printStackTrace();
53 | }
54 | return entities;
55 | }
56 |
57 | /**
58 | * 将 Object 对象转为 String
59 | * @param jsonData json对象
60 | * @return json字符串
61 | */
62 | public static String object2JsonStr(Object jsonData) {
63 | return sGson.toJson(jsonData);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/shape_edit_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/v2_sel_btn_send.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
8 |
9 |
10 |
11 |
12 | -
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/v2_sel_btn_send_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/v2_shape_comment_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_custom_danmaku.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
22 |
23 |
30 |
31 |
38 |
39 |
57 |
58 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_ijk_player.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
22 |
23 |
30 |
31 |
39 |
40 |
57 |
58 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
22 |
23 |
32 |
33 |
42 |
43 |
52 |
53 |
62 |
63 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_switch_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
27 |
28 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_test_aspect.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
20 |
21 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/adapter_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_danmaku_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/sample/src/main/res/mipmap-hdpi/ic_danmaku_send.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_danmaku_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/sample/src/main/res/mipmap-xhdpi/ic_danmaku_send.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/bg_card.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/sample/src/main/res/mipmap-xxhdpi/bg_card.9.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/photo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/sample/src/main/res/mipmap-xxhdpi/photo.jpg
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_danmaku_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rukey7/IjkPlayerView/a2ce0666d0f5147bdde3621fb2fd8d753eddbc64/sample/src/main/res/mipmap-xxxhdpi/ic_danmaku_send.png
--------------------------------------------------------------------------------
/sample/src/main/res/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/sample/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | IjkPlayerView
3 | Edward Thomas \'Tom\' Hardy (born 15 September 1977) is an English actor, screenwriter, and producer. He made his debut in Ridley Scott\'s 2001 action film Black Hawk Down. Hardy\'s other notable films include the science fiction film Star Trek: Nemesis (2002), the crime film RocknRolla (2008), biographical psychological drama Bronson (2008), science fiction thriller Inception (2010), sports drama Warrior (2011), Cold War espionage film Tinker Tailor Soldier Spy (2011), crime drama Lawless (2012), drama Locke (2013), mobster film The Drop (2014), and the biographical western thriller The Revenant (2015), for which he received an Academy Award nomination for Best Supporting Actor. He also portrayed Bane in the superhero film The Dark Knight Rises (2012), \'Mad\' Max Rockatansky in the post-apocalyptic film Mad Max: Fury Road (2015), and both Kray twins in the crime thriller Legend (2015). Hardy\'s television roles include the HBO war drama miniseries Band of Brothers (2001), the BBC historical drama miniseries The Virgin Queen (2005), ITV\'s Wuthering Heights (2008), the Sky 1 drama series The Take (2009), and the BBC British historical crime drama television series Peaky Blinders (2013). Hardy has also performed on British and American stages. He was nominated for the Laurence Olivier Award for Most Promising Newcomer for his role as Skank in the 2003 production of In Arabia We\'d All Be Kings, and was awarded the 2003 London Evening Standard Theatre Award for Outstanding Newcomer for his performances in both In Arabia We\'d All be Kings and for his role as Luca in Blood. He starred in the 2007 production of The Man of Mode and received positive reviews for his role in the 2010 Philip Seymour Hoffman-directed play The Long Red Road.
4 |
5 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sample/src/test/java/com/dl7/playerdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.dl7.playerdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':sample', ':playerview'
2 |
--------------------------------------------------------------------------------