Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Feb 26, 2016
2 parents 3f8e416 + f67780c commit 3dde030
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 36 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) [year] [fullname]
Copyright (c) 2015-2016 jiecao.fm:Nathen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
77 changes: 51 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
#节操视频播放器
#节操视频播放器 [![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html) [![Maven Central](https://img.shields.io/badge/Maven%20Central-1.6-green.svg)](http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C1.6%7Caar) [![Licenses](https://img.shields.io/badge/license-MIT-green.svg)](http://choosealicense.com/licenses/mit/)

真正实现Android的全屏功能,励志成为Android平台使用最广泛的视频播放控件,GitFlow流程开发develop分支是最新版本

##主要特点
1. 全屏时启动新Activity实现播放器真正的全屏功能
1. 全屏时启动新`Activity`实现播放器真正的全屏功能
2. 可以在加载、暂停、播放等各种状态中正常进入全屏和退出全屏
3. 播放MP3时现实缩略图片
4. 能在ListView、ViewPager和ListView、ViewPager和Fragment的多重嵌套模式下全屏工作
5. ListView的拖拽和ViewPager的滑动时如果划出屏幕会自动重置视频
4. 能在`ListView``ViewPager``ListView``ViewPager``Fragment`的多重嵌套模式下全屏工作
5. `ListView`的拖拽和`ViewPager`的滑动时如果划出屏幕会自动重置视频
6. 根据自己应用的颜色风格换肤
7. 视频大小的屏幕适配,宽或长至少有两个对边是充满屏幕的,另外两个方向居中

##效果

![Demo Screenshot][1]

视频演示 : http://v.youku.com/v_show/id_XMTQ2NzUwOTcyNA==.html?firsttime=0&from=y1.4-2


##使用
引入类库
```java
compile 'fm.jiecao:jiecaovideoplayer:1.5'
```gradle
compile 'fm.jiecao:jiecaovideoplayer:1.6'
```

添加布局
```html
```xml
<fm.jiecao.jcvideoplayer_lib.JCVideoPlayer
android:id="@+id/videocontroller1"
android:layout_width="match_parent"
android:layout_height="200dp" />
android:id="@+id/videocontroller1"
android:layout_width="match_parent"
android:layout_height="200dp" />
```

设置视频地址、缩略图地址、标题
```java
JCVideoPlayer videoController = (JCVideoPlayer) findViewById(R.id.videocontroller);
videoController.setUp("http://2449.vod.myqcloud.com/2449_43b6f696980311e59ed467f22794e792.f20.mp4",
"http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640",
"嫂子别摸我");
```

其他接口,停止所有视频
```java
JCVideoPlayer.releaseAllVideo();
"http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640",
"嫂子别摸我");
```

设置皮肤,可以指定某个播放器的皮肤,也可以设置全局皮肤,优先级:某个播放器皮肤>全局皮肤>默认皮肤
Expand All @@ -43,23 +46,45 @@ JCVideoPlayer.setGlobleSkin();//设置全局皮肤
videoController.setSkin();//设置这一个播放器的皮肤
```

在ListView和ViewPager中将视频移除屏幕外,会在onDetachedFromWindow时重置视频。
停止所有视频
```java
JCVideoPlayer.releaseAllVideo();
```

目标是在库外只需要添加布局,添加配置,其他的问题都在库内判断和操作。

如果JCVideoPlayer这个View能检测到自己的Activity或者Fragment的生命周期JCVideoPlayer.releaseAllVideo();这个接口暴露出来都略显多余
在包含播放器的`Fragment``Activity``onPause()`方法中调用`JCVideoPlayer.releaseAllVideos();`

在ListView和ViewPager中将视频移除屏幕外,会在onDetachedFromWindow时重置视频。
目标是在库外只需要添加布局,添加配置,其他的问题都在库内判断和操作。

##下载
* **[jiecaovideoplayer-1.5-demo.apk](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.5-demo.apk)**
* **[jiecaovideoplayer-1.5.aar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.5.aar)**
* **[jiecaovideoplayer-1.5-javadoc.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.5-javadoc.jar)**
* **[jiecaovideoplayer-1.5-sources.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.5-sources.jar)**

##效果
## License

![Demo Screenshot][1]

http://v.youku.com/v_show/id_XMTQ2NzUwOTcyNA==.html?firsttime=0&from=y1.4-2
The MIT License (MIT)

Copyright (c) 2015-2016 jiecao.fm:Nathen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


[1]: ./effect.gif
[1]: ./screenshots/j1.png
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "fm.jiecao.jiecaovideoplayer"
minSdkVersion 16
targetSdkVersion 23
versionCode 16
versionName "1.5"
versionCode 17
versionName "1.6"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.view.MenuItem;
import android.widget.ListView;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;

/**
* Created by Nathen
* On 2016/02/06 19:12
Expand All @@ -26,6 +28,11 @@ protected void onCreate(Bundle savedInstanceState) {
listView.setAdapter(new VideoListAdapter(this));
}

@Override
protected void onPause() {
super.onPause();
JCVideoPlayer.releaseAllVideos();
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ protected void onCreate(Bundle savedInstanceState) {
viewPager.setOnPageChangeListener(this);
}

@Override
protected void onPause() {
super.onPause();
JCVideoPlayer.releaseAllVideos();
}

@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected void onCreate(Bundle savedInstanceState) {

videoController3 = (JCVideoPlayer) findViewById(R.id.videocontroller3);
videoController3.setUp("http://121.40.64.47/resource/mp3/music_yangguang3.mp3",//
"http://p.qpic.cn/videoyun/0/2449_ded7b566b37911e5942f0b208e48548d_2/640",
"http://p.qpic.cn/videoyun/0/2449_38e65894d9e211e5b0e0a3699ca1d490_1/640",
"嫂子别闹");

btnToList = (Button) findViewById(R.id.to_list_activity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ protected void onCreate(Bundle savedInstanceState) {

}

@Override
protected void onPause() {
super.onPause();
JCVideoPlayer.releaseAllVideos();
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
Expand Down
Binary file removed effect.gif
Binary file not shown.
9 changes: 6 additions & 3 deletions gradle/maven_push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,27 @@ apply plugin: 'signing'
//}

signing {
required { false }
sign configurations.archives
}

group = "fm.jiecao"
archivesBaseName = "jiecaovideoplayer"
version = "1.5"
version = "1.6"

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
authentication(userName: hasProperty('ossrhUsername') ? ossrhUsername : "",
password: hasProperty('ossrhPassword') ? ossrhPassword : "")
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
authentication(userName: hasProperty('ossrhUsername') ? ossrhUsername : "",
password: hasProperty('ossrhPassword') ? ossrhPassword : "")
}

pom.project {
Expand Down
4 changes: 2 additions & 2 deletions jcvideoplayer-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 16
versionName "1.5"
versionCode 17
versionName "1.6"
}
buildTypes {
release {
Expand Down
Binary file added screenshots/j1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3dde030

Please sign in to comment.