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.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Feb 21, 2016
2 parents 1a2c41b + 91165e8 commit ab03fcb
Show file tree
Hide file tree
Showing 16 changed files with 376 additions and 260 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
gradle.properties
*.iml
.gradle
/local.properties
.idea
.DS_Store
/build
/captures
*.asc
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
真正实现Android的全屏功能,励志成为Android平台使用最广泛的视频播放控件

##使用
引入类库
```java
compile 'fm.jiecao:jiecaovideoplayer:1.2_preview'
```

添加布局
```html
<fm.jiecao.jcvideoplayer_lib.JCVideoPlayer
Expand All @@ -23,11 +28,18 @@ videoController.setUp("http://2449.vod.myqcloud.com/2449_43b6f696980311e59ed467f
```
JCVideoPlayer.releaseAllVideo();
```

在ListView和ViewPager中将视频移除屏幕外,会在onDetachedFromWindow时重置视频。

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

如果JCVideoPlayer这个View能检测到自己的Activity或者Fragment的生命周期JCVideoPlayer.releaseAllVideo();这个接口暴露出来都略显多余

##效果

![Demo Screenshot][1]

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


[1]: ./effect.gif
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
package fm.jiecao.jiecaovideoplayer;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;

/**
* Created by Nathen
* On 2016/02/06 19:12
Expand All @@ -34,7 +27,6 @@ protected void onCreate(Bundle savedInstanceState) {
}



@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_list_viewpager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
android:id="@+id/viewPager"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.junit.Test;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;

/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
Expand Down
18 changes: 0 additions & 18 deletions gradle.properties

This file was deleted.

93 changes: 93 additions & 0 deletions gradle/maven_push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apply plugin: 'maven'
apply plugin: 'signing'

//task javadocJar(type: Jar) {
// classifier = 'javadoc'
// from javadoc
//}
//
//task sourcesJar(type: Jar) {
// classifier = 'sources'
// from sourceSets.main.allSource
//}

//artifacts {
// archives file('../downloads/jiecao-videoplayer-1.2preview.aar')
//}

signing {
sign configurations.archives
}

group = "fm.jiecao"
archivesBaseName = "jiecaovideoplayer"
version = "1.2"

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)
}

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

pom.project {
name 'jiecaovideoplayer'
packaging 'jar'
// optionally artifactId can be defined here
description 'android videoplayer videoview 安卓视频播放器 全屏 播放器列表全屏 仿今日头条UI'
url 'https://github.com/lipangit/jiecaovideoplayer'

scm {
connection 'https://github.com/lipangit/jiecaovideoplayer'
developerConnection 'https://github.com/lipangit/jiecaovideoplayer'
url 'https://github.com/lipangit/jiecaovideoplayer'
}

licenses {
license {
name 'MIT'
url 'http://mit-license.org/'
}
}

developers {
developer {
id 'Nathen'
name 'Nathen'
email '[email protected]'
}
}
}
}
}
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
options {
encoding = "UTF-8"
}
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}

6 changes: 4 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 12
versionName "1.2_preview"
versionCode 13
versionName "1.2"
}
buildTypes {
release {
Expand All @@ -28,3 +28,5 @@ dependencies {
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
}

apply from: '../gradle/maven_push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
* On 2015/12/01 11:17
*/
public class FullScreenActivity extends Activity {
/**
* TODO 可能有需求直接进入全屏,退出就退出播放,没有非全屏的需求
* state是当前的播放状态,全屏之后要继续原来的状态
*/

public static void toActivity(Context context, int state, String url, String thumb, String title) {
STATE = state;
URL = url;
Expand Down Expand Up @@ -47,7 +44,7 @@ protected void onCreate(Bundle savedInstanceState) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.activity_fullscreen);
jcVideoPlayer = (JCVideoPlayer) findViewById(R.id.jcvideoplayer);
jcVideoPlayer.setUpForFullscreen(URL, THUMB, TITLE, true);
jcVideoPlayer.setUpForFullscreen(URL, THUMB, TITLE);
jcVideoPlayer.setState(STATE);
JCMediaPlayer.intance().setUuid(jcVideoPlayer.uuid);
manualQuit = false;
Expand Down
Loading

0 comments on commit ab03fcb

Please sign in to comment.