forked from catchfishday/ijkplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
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
zhangyang
committed
May 10, 2016
1 parent
72ff40e
commit 5696e75
Showing
163 changed files
with
4,305 additions
and
5,095 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,35 @@ | ||
#built application files | ||
*.apk | ||
*.ap_ | ||
*.iml | ||
|
||
# files for the dex VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# generated files | ||
bin/ | ||
gen/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Windows thumbnail db | ||
Thumbs.db | ||
|
||
# OSX files | ||
.DS_Store | ||
|
||
# Eclipse project files | ||
.classpath | ||
.project | ||
|
||
# Android Studio | ||
.idea/ | ||
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs. | ||
.gradle | ||
build/ | ||
Medusa/src/main/res/values/com_crashlytics_export_strings.xml | ||
ThirdLibs/ImageGalleryLibrary/ImageGalleryLibrary.iml |
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,27 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.2" | ||
|
||
defaultConfig { | ||
minSdkVersion 15 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile 'tv.danmaku.ijk.media:ijkplayer-java:0.4.5.1' | ||
compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.4.5.1' | ||
compile 'com.android.support:appcompat-v7:23.2.1' | ||
compile 'com.android.support:preference-v7:23.2.1' | ||
} |
2 changes: 1 addition & 1 deletion
2
player-java/proguard-rules.pro → IjkplayerLib/proguard-rules.pro
100755 → 100644
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
2 changes: 1 addition & 1 deletion
2
...aku/ijk/media/player/ApplicationTest.java → ...angyang/ijkplayerlib/ApplicationTest.java
100755 → 100644
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
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,10 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="tv.danmaku.ijk.media.playerLib"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:supportsRtl="true"> | ||
|
||
</application> | ||
|
||
</manifest> |
62 changes: 62 additions & 0 deletions
62
IjkplayerLib/src/main/java/tv/danmaku/ijk/media/services/MediaPlayerService.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,62 @@ | ||
/* | ||
* Copyright (C) 2015 Zhang Rui <[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.services; | ||
|
||
import android.app.Service; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.os.IBinder; | ||
import android.support.annotation.Nullable; | ||
|
||
import tv.danmaku.ijk.media.player.IMediaPlayer; | ||
|
||
public class MediaPlayerService extends Service { | ||
private static IMediaPlayer sMediaPlayer; | ||
|
||
public static Intent newIntent(Context context) { | ||
Intent intent = new Intent(context, MediaPlayerService.class); | ||
return intent; | ||
} | ||
|
||
public static void intentToStart(Context context) { | ||
context.startService(newIntent(context)); | ||
} | ||
|
||
public static void intentToStop(Context context) { | ||
context.stopService(newIntent(context)); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public IBinder onBind(Intent intent) { | ||
return null; | ||
} | ||
|
||
public static void setMediaPlayer(IMediaPlayer mp) { | ||
if (sMediaPlayer != null && sMediaPlayer != mp) { | ||
if (sMediaPlayer.isPlaying()) | ||
sMediaPlayer.stop(); | ||
sMediaPlayer.release(); | ||
sMediaPlayer = null; | ||
} | ||
sMediaPlayer = mp; | ||
} | ||
|
||
public static IMediaPlayer getMediaPlayer() { | ||
return sMediaPlayer; | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
IjkplayerLib/src/main/java/tv/danmaku/ijk/media/widget/Settings.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,104 @@ | ||
/* | ||
* Copyright (C) 2015 Zhang Rui <[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.widget; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
import android.preference.PreferenceManager; | ||
|
||
import tv.danmaku.ijk.media.playerLib.R; | ||
|
||
|
||
public class Settings { | ||
private Context mAppContext; | ||
private SharedPreferences mSharedPreferences; | ||
|
||
public static final int PV_PLAYER__Auto = 0; | ||
public static final int PV_PLAYER__AndroidMediaPlayer = 1; | ||
public static final int PV_PLAYER__IjkMediaPlayer = 2; | ||
public static final int PV_PLAYER__IjkExoMediaPlayer = 3; | ||
|
||
public Settings(Context context) { | ||
mAppContext = context.getApplicationContext(); | ||
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(mAppContext); | ||
} | ||
|
||
public boolean getEnableBackgroundPlay() { | ||
String key = mAppContext.getString(R.string.pref_key_enable_background_play); | ||
return mSharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public int getPlayer() { | ||
String key = mAppContext.getString(R.string.pref_key_player); | ||
String value = mSharedPreferences.getString(key, ""); | ||
try { | ||
return Integer.valueOf(value).intValue(); | ||
} catch (NumberFormatException e) { | ||
return 0; | ||
} | ||
} | ||
|
||
public boolean getUsingMediaCodec() { | ||
String key = mAppContext.getString(R.string.pref_key_using_media_codec); | ||
return mSharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public boolean getUsingMediaCodecAutoRotate() { | ||
String key = mAppContext.getString(R.string.pref_key_using_media_codec_auto_rotate); | ||
return mSharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public boolean getUsingOpenSLES() { | ||
String key = mAppContext.getString(R.string.pref_key_using_opensl_es); | ||
return mSharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public String getPixelFormat() { | ||
String key = mAppContext.getString(R.string.pref_key_pixel_format); | ||
return mSharedPreferences.getString(key, ""); | ||
} | ||
|
||
public boolean getEnableNoView() { | ||
String key = mAppContext.getString(R.string.pref_key_enable_no_view); | ||
return mSharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public boolean getEnableSurfaceView() { | ||
String key = mAppContext.getString(R.string.pref_key_enable_surface_view); | ||
return mSharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public boolean getEnableTextureView() { | ||
String key = mAppContext.getString(R.string.pref_key_enable_texture_view); | ||
return mSharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public boolean getEnableDetachedSurfaceTextureView() { | ||
String key = mAppContext.getString(R.string.pref_key_enable_detached_surface_texture); | ||
return mSharedPreferences.getBoolean(key, false); | ||
} | ||
|
||
public String getLastDirectory() { | ||
String key = mAppContext.getString(R.string.pref_key_last_directory); | ||
return mSharedPreferences.getString(key, "/"); | ||
} | ||
|
||
public void setLastDirectory(String path) { | ||
String key = mAppContext.getString(R.string.pref_key_last_directory); | ||
mSharedPreferences.edit().putString(key, path).commit(); | ||
} | ||
} |
94 changes: 94 additions & 0 deletions
94
IjkplayerLib/src/main/java/tv/danmaku/ijk/media/widget/media/AndroidMediaController.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,94 @@ | ||
/* | ||
* Copyright (C) 2015 Zhang Rui <[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.widget.media; | ||
|
||
import android.content.Context; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.ActionBar; | ||
import android.util.AttributeSet; | ||
import android.view.View; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class AndroidMediaController extends PlayerMediaController implements IMediaController { | ||
private ActionBar mActionBar; | ||
|
||
public AndroidMediaController(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
initView(context); | ||
} | ||
|
||
public AndroidMediaController(Context context, boolean useFastForward) { | ||
super(context); | ||
initView(context); | ||
} | ||
|
||
public AndroidMediaController(Context context) { | ||
super(context); | ||
initView(context); | ||
} | ||
|
||
protected void initView(Context context) { | ||
} | ||
|
||
public void setSupportActionBar(@Nullable ActionBar actionBar) { | ||
mActionBar = actionBar; | ||
if (isShowing()) { | ||
actionBar.show(); | ||
} else { | ||
actionBar.hide(); | ||
} | ||
} | ||
|
||
@Override | ||
public void show() { | ||
super.show(); | ||
if (mActionBar != null) | ||
mActionBar.show(); | ||
} | ||
|
||
@Override | ||
public void hide() { | ||
super.hide(); | ||
if (mActionBar != null) | ||
mActionBar.hide(); | ||
for (View view : mShowOnceArray) | ||
view.setVisibility(View.GONE); | ||
mShowOnceArray.clear(); | ||
} | ||
|
||
//---------- | ||
// Extends | ||
//---------- | ||
private ArrayList<View> mShowOnceArray = new ArrayList<View>(); | ||
|
||
public void showOnce(@NonNull View view) { | ||
mShowOnceArray.add(view); | ||
view.setVisibility(View.VISIBLE); | ||
show(); | ||
} | ||
|
||
@Override | ||
public void setAnchorView(View view) { | ||
super.setAnchorView(view); | ||
} | ||
|
||
public void setLiveRoomCount(String count) { | ||
|
||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (C) 2013-2014 Zhang Rui <[email protected]> | ||
* Copyright (C) 2015 Zhang Rui <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -14,16 +14,28 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
package tv.danmaku.ijk.media.player; | ||
package tv.danmaku.ijk.media.widget.media; | ||
|
||
public class MediaInfo { | ||
public String mMediaPlayerName; | ||
import android.view.View; | ||
import android.widget.MediaController; | ||
|
||
public String mVideoDecoder; | ||
public String mVideoDecoderImpl; | ||
public interface IMediaController { | ||
void hide(); | ||
|
||
public String mAudioDecoder; | ||
public String mAudioDecoderImpl; | ||
boolean isShowing(); | ||
|
||
public IjkMediaMeta mMeta; | ||
void setAnchorView(View view); | ||
|
||
void setEnabled(boolean enabled); | ||
|
||
void setMediaPlayer(MediaController.MediaPlayerControl player); | ||
|
||
void show(int timeout); | ||
|
||
void show(); | ||
|
||
//---------- | ||
// Extends | ||
//---------- | ||
void showOnce(View view); | ||
} |
Oops, something went wrong.