-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
194 changed files
with
9,704 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion '26.0.2' | ||
|
||
defaultConfig { | ||
minSdkVersion 14 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
lintOptions { | ||
checkReleaseBuilds false | ||
// Or, if you prefer, you can continue to checkforerrorsinrelease builds, | ||
// but continue the build even whenerrorsarefound: | ||
abortOnError false | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
testCompile 'junit:junit:4.12' | ||
compile 'com.android.support:appcompat-v7:23.4.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /usr/local/softs/android-sdk-linux/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="tv.danmaku.ijk.media.player" > | ||
|
||
<uses-sdk | ||
android:minSdkVersion="9" /> | ||
|
||
</manifest> |
106 changes: 106 additions & 0 deletions
106
Ijkplayer/src/main/java/tv/danmaku/ijk/media/player/AbstractMediaPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* Copyright (C) 2013-2014 Zhang Rui <[email protected]> | ||
* Copyright (C) 2016 hejunlin <[email protected]> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package tv.danmaku.ijk.media.player; | ||
|
||
public abstract class AbstractMediaPlayer implements IMediaPlayer { | ||
private OnPreparedListener mOnPreparedListener; | ||
private OnCompletionListener mOnCompletionListener; | ||
private OnBufferingUpdateListener mOnBufferingUpdateListener; | ||
private OnSeekCompleteListener mOnSeekCompleteListener; | ||
private OnVideoSizeChangedListener mOnVideoSizeChangedListener; | ||
private OnErrorListener mOnErrorListener; | ||
private OnInfoListener mOnInfoListener; | ||
|
||
public final void setOnPreparedListener(OnPreparedListener listener) { | ||
mOnPreparedListener = listener; | ||
} | ||
|
||
public final void setOnCompletionListener(OnCompletionListener listener) { | ||
mOnCompletionListener = listener; | ||
} | ||
|
||
public final void setOnBufferingUpdateListener( | ||
OnBufferingUpdateListener listener) { | ||
mOnBufferingUpdateListener = listener; | ||
} | ||
|
||
public final void setOnSeekCompleteListener(OnSeekCompleteListener listener) { | ||
mOnSeekCompleteListener = listener; | ||
} | ||
|
||
public final void setOnVideoSizeChangedListener( | ||
OnVideoSizeChangedListener listener) { | ||
mOnVideoSizeChangedListener = listener; | ||
} | ||
|
||
public final void setOnErrorListener(OnErrorListener listener) { | ||
mOnErrorListener = listener; | ||
} | ||
|
||
public final void setOnInfoListener(OnInfoListener listener) { | ||
mOnInfoListener = listener; | ||
} | ||
|
||
public void resetListeners() { | ||
mOnPreparedListener = null; | ||
mOnBufferingUpdateListener = null; | ||
mOnCompletionListener = null; | ||
mOnSeekCompleteListener = null; | ||
mOnVideoSizeChangedListener = null; | ||
mOnErrorListener = null; | ||
mOnInfoListener = null; | ||
} | ||
|
||
protected final void notifyOnPrepared() { | ||
if (mOnPreparedListener != null) | ||
mOnPreparedListener.onPrepared(this); | ||
} | ||
|
||
protected final void notifyOnCompletion() { | ||
if (mOnCompletionListener != null) | ||
mOnCompletionListener.onCompletion(this); | ||
} | ||
|
||
protected final void notifyOnBufferingUpdate(int percent) { | ||
if (mOnBufferingUpdateListener != null) | ||
mOnBufferingUpdateListener.onBufferingUpdate(this, percent); | ||
} | ||
|
||
protected final void notifyOnSeekComplete() { | ||
if (mOnSeekCompleteListener != null) | ||
mOnSeekCompleteListener.onSeekComplete(this); | ||
} | ||
|
||
protected final void notifyOnVideoSizeChanged(int width, int height, | ||
int sarNum, int sarDen) { | ||
if (mOnVideoSizeChangedListener != null) | ||
mOnVideoSizeChangedListener.onVideoSizeChanged(this, width, height, | ||
sarNum, sarDen); | ||
} | ||
|
||
protected final boolean notifyOnError(int what, int extra) { | ||
if (mOnErrorListener != null) | ||
return mOnErrorListener.onError(this, what, extra); | ||
return false; | ||
} | ||
|
||
protected final boolean notifyOnInfo(int what, int extra) { | ||
if (mOnInfoListener != null) | ||
return mOnInfoListener.onInfo(this, what, extra); | ||
return false; | ||
} | ||
} |
Oops, something went wrong.