Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jianjunxiao committed Sep 19, 2017
1 parent c70d273 commit 883d8dd
Show file tree
Hide file tree
Showing 23 changed files with 254 additions and 18 deletions.
228 changes: 228 additions & 0 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/dictionaries/PC.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -1,6 +1,7 @@
package com.xiao.nicevieoplayer.example;

import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;
Expand All @@ -24,8 +25,9 @@ protected void onCreate(Bundle savedInstanceState) {

private void init() {
mNiceVideoPlayer = (NiceVideoPlayer) findViewById(R.id.nice_video_player);
mNiceVideoPlayer.setPlayerType(NiceVideoPlayer.TYPE_IJK); // IjkPlayer or MediaPlayer
mNiceVideoPlayer.setUp("http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-17_17-33-30.mp4", null);
mNiceVideoPlayer.setPlayerType(NiceVideoPlayer.TYPE_NATIVE); // IjkPlayer or MediaPlayer
String videoUrl = Environment.getExternalStorageDirectory().getPath().concat("/办公室小野.mp4");
mNiceVideoPlayer.setUp(videoUrl, null);
TxVideoPlayerController controller = new TxVideoPlayerController(this);
controller.setTitle("办公室小野开番外了,居然在办公室开澡堂!老板还点赞?");
controller.setLenght(98000);
Expand Down
4 changes: 2 additions & 2 deletions config.gradle
Expand Up @@ -5,8 +5,8 @@ ext {
buildToolsVersion: "25.0.2",
minSdkVersion : 16,
targetSdkVersion : 25,
versionCode : 21,
versionName : "2.1"
versionCode : 22,
versionName : "2.2"
]

dependVersion = [
Expand Down
18 changes: 8 additions & 10 deletions nicevideoplayer/build.gradle
Expand Up @@ -12,6 +12,7 @@ android {
versionName rootProject.ext.android.versionName

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

ndk {
abiFilters 'armeabi', 'armeabi-v7a', 'x86'
}
Expand Down Expand Up @@ -45,16 +46,13 @@ dependencies {
})
compile rootProject.ext.dependencies.appcompatV7
compile rootProject.ext.dependencies.junit
// required, enough for most devices.
compile 'tv.danmaku.ijk.media:ijkplayer-java:0.8.1'
// compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.1'
// Other ABIs: optional
// compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.1'
// compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.1'
// compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.1'
// compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.1'
// ExoPlayer as IMediaPlayer: optional, experimental
// compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.1'
compile 'tv.danmaku.ijk.media:ijkplayer-java:0.8.3'
compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.3'
compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.3'
compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.3'
// compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.3'
compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.3'
// compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.3'
}

//apply plugin: 'com.github.dcendents.android-maven'
Expand Down
Binary file removed nicevideoplayer/libs/arm64-v8a/libijkffmpeg.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/arm64-v8a/libijkplayer.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/arm64-v8a/libijksdl.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/armeabi-v7a/libijkffmpeg.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/armeabi-v7a/libijkplayer.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/armeabi-v7a/libijksdl.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/armeabi/libijkffmpeg.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/armeabi/libijkplayer.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/armeabi/libijksdl.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/x86/libijkffmpeg.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/x86/libijkplayer.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/x86/libijksdl.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/x86_64/libijkffmpeg.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/x86_64/libijkplayer.so
Binary file not shown.
Binary file removed nicevideoplayer/libs/x86_64/libijksdl.so
Binary file not shown.
Expand Up @@ -80,7 +80,7 @@ public interface INiceVideoPlayer {
boolean isCompleted();

/*********************************
* 以下93个方法是播放器的模式
* 以下3个方法是播放器的模式
**********************************/
boolean isFullScreen();
boolean isTinyWindow();
Expand Down
Expand Up @@ -360,6 +360,11 @@ private void initMediaPlayer() {
case TYPE_IJK:
default:
mMediaPlayer = new IjkMediaPlayer();
((IjkMediaPlayer)mMediaPlayer).setOption(1, "analyzemaxduration", 100L);
((IjkMediaPlayer)mMediaPlayer).setOption(1, "probesize", 10240L);
((IjkMediaPlayer)mMediaPlayer).setOption(1, "flush_packets", 1L);
((IjkMediaPlayer)mMediaPlayer).setOption(4, "packet-buffering", 0L);
((IjkMediaPlayer)mMediaPlayer).setOption(4, "framedrop", 1L);
break;
}
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
Expand Down Expand Up @@ -393,7 +398,7 @@ public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width,
}

private void openMediaPlayer() {
// 屏幕常量
// 屏幕常亮
mContainer.setKeepScreenOn(true);
// 设置监听
mMediaPlayer.setOnPreparedListener(mOnPreparedListener);
Expand Down Expand Up @@ -468,7 +473,7 @@ public void onCompletion(IMediaPlayer mp) {
mCurrentState = STATE_COMPLETED;
mController.onPlayStateChanged(mCurrentState);
LogUtil.d("onCompletion ——> STATE_COMPLETED");
// 清除屏幕常量
// 清除屏幕常亮
mContainer.setKeepScreenOn(false);
}
};
Expand Down
Expand Up @@ -127,7 +127,7 @@ public void run() {
}
};
}
mUpdateProgressTimer.schedule(mUpdateProgressTimerTask, 0, 300);
mUpdateProgressTimer.schedule(mUpdateProgressTimerTask, 0, 1000);
}

/**
Expand Down

0 comments on commit 883d8dd

Please sign in to comment.