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/v2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Apr 9, 2016
2 parents 4cd1d47 + 74271f1 commit 14675d9
Show file tree
Hide file tree
Showing 24 changed files with 280 additions and 38 deletions.
12 changes: 6 additions & 6 deletions README-ZH.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#节操视频播放器

[![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-2.0_preview-green.svg)](http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C2.0_preview%7Caar)
[![Maven Central](https://img.shields.io/badge/Maven%20Central-2.0-green.svg)](http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C2.0%7Caar)
[![Licenses](https://img.shields.io/badge/license-MIT-green.svg)](http://choosealicense.com/licenses/mit/)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-jiecaovideoplayer-green.svg?style=true)](https://android-arsenal.com/details/1/3269)
[![GitHub stars](https://img.shields.io/github/stars/lipangit/jiecaovideoplayer.svg?style=social&label=Star)]()
Expand All @@ -20,7 +20,7 @@

##效果

**[jiecaovideoplayer-2.0_preview-demo.apk](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0_preview-demo.apk)**
**[jiecaovideoplayer-2.0-demo.apk](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0-demo.apk)**

![Demo Screenshot][1]

Expand All @@ -29,14 +29,14 @@
##使用
1.添加类库
```gradle
compile 'fm.jiecao:jiecaovideoplayer:2.0_preview'
compile 'fm.jiecao:jiecaovideoplayer:2.0'
```

或直接下载

* [jiecaovideoplayer-2.0_preview.aar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0_preview.aar)
* [jiecaovideoplayer-2.0_preview-javadoc.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0_preview-javadoc.jar)
* [jiecaovideoplayer-2.0_preview-sources.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0_preview-sources.jar)
* [jiecaovideoplayer-2.0.aar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0.aar)
* [jiecaovideoplayer-2.0-javadoc.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0-javadoc.jar)
* [jiecaovideoplayer-2.0-sources.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0-sources.jar)

2.添加布局
```xml
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Jiecao Video Player

[![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-2.0_preview-green.svg)](http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C2.0_preview%7Caar)
[![Maven Central](https://img.shields.io/badge/Maven%20Central-2.0-green.svg)](http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C2.0%7Caar)
[![Licenses](https://img.shields.io/badge/license-MIT-green.svg)](http://choosealicense.com/licenses/mit/)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-jiecaovideoplayer-green.svg?style=true)](https://android-arsenal.com/details/1/3269)
[![GitHub stars](https://img.shields.io/github/stars/lipangit/jiecaovideoplayer.svg?style=social&label=Star)]()
Expand All @@ -22,7 +22,7 @@ This is the real android video player view with fullscreen function, we are dedi

## Effect

**[jiecaovideoplayer-2.0_preview-demo.apk](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0_preview-demo.apk)**
**[jiecaovideoplayer-2.0-demo.apk](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0-demo.apk)**

![Demo Screenshot][1]

Expand All @@ -31,14 +31,14 @@ Demo video : http://v.youku.com/v_show/id_XMTQ2NzUwOTcyNA==.html
## Usage
1.Import library
```gradle
compile 'fm.jiecao:jiecaovideoplayer:2.0_preview'
compile 'fm.jiecao:jiecaovideoplayer:2.0'
```

Or download lib

* [jiecaovideoplayer-2.0_preview.aar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0_preview.aar)
* [jiecaovideoplayer-2.0_preview-javadoc.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0_preview-javadoc.jar)
* [jiecaovideoplayer-2.0_preview-sources.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0_preview-sources.jar)
* [jiecaovideoplayer-2.0.aar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0.aar)
* [jiecaovideoplayer-2.0-javadoc.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0-javadoc.jar)
* [jiecaovideoplayer-2.0-sources.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-2.0-sources.jar)

2.Add JCVideoPlayer in your layout
```xml
Expand Down
7 changes: 6 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 16
targetSdkVersion 23
versionCode 22
versionName "2.0_preview"
versionName "2.0"
}
buildTypes {
release {
Expand All @@ -27,5 +27,10 @@ dependencies {
testCompile 'junit:junit:4.12'
compile project(':jcvideoplayer-lib')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.squareup.picasso:picasso:2.5.1'
compile 'com.facebook.fresco:fresco:0.9.0+'
compile 'com.mcxiaoke.volley:library:1.0.7'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
}
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@
<activity
android:name=".ListActivity"
android:screenOrientation="portrait" />

<activity
android:name=".ListViewpagerActivity"
android:screenOrientation="portrait" />

<activity
android:name=".SetSkinActivity"
android:screenOrientation="portrait" />

<activity
android:name=".LoadImageActivity"
android:screenOrientation="portrait" />
</application>

</manifest>
107 changes: 107 additions & 0 deletions app/src/main/java/fm/jiecao/jiecaovideoplayer/LoadImageActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package fm.jiecao.jiecaovideoplayer;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.util.LruCache;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.bumptech.glide.Glide;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.squareup.picasso.Picasso;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;

/**
* Created by Nathen
* On 2016/04/07 18:14
*/
public class LoadImageActivity extends AppCompatActivity {

JCVideoPlayer videoController1, videoController2, videoController3, videoController4;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loadimage);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(false);

videoController1 = (JCVideoPlayer) findViewById(R.id.videocontroller1);
videoController1.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4",
"嫂子张嘴");
ImageLoader.getInstance().displayImage("http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1458036374.jpg",
videoController1.ivThumb);

videoController2 = (JCVideoPlayer) findViewById(R.id.videocontroller2);
videoController2.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4",
"嫂子抬头");
Glide.with(this)
.load("http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1458036374.jpg")
.into(videoController2.ivThumb);

videoController3 = (JCVideoPlayer) findViewById(R.id.videocontroller3);
videoController3.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4",
"嫂子不困");
Picasso.with(this)
.load("http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1458036374.jpg")
.into(videoController3.ivThumb);

videoController4 = (JCVideoPlayer) findViewById(R.id.videocontroller4);
videoController4.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4",
"嫂子你个死猪");
// Picasso.with(this)
// .load("http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1458036374.jpg")
// .into(videoController3.ivThumb);
RequestQueue mQueue = Volley.newRequestQueue(getApplicationContext());
com.android.volley.toolbox.ImageLoader imageLoader = new com.android.volley.toolbox.ImageLoader(mQueue, new BitmapCache());
com.android.volley.toolbox.ImageLoader.ImageListener listener =
com.android.volley.toolbox.ImageLoader.getImageListener(videoController4.ivThumb, R.mipmap.ic_launcher, R.mipmap.ic_launcher);
imageLoader.get("http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1458036374.jpg", listener);


}

public class BitmapCache implements com.android.volley.toolbox.ImageLoader.ImageCache {
private LruCache<String, Bitmap> cache;

public BitmapCache() {
cache = new LruCache<String, Bitmap>(8 * 1024 * 1024) {
@Override
protected int sizeOf(String key, Bitmap bitmap) {
return bitmap.getRowBytes() * bitmap.getHeight();
}
};
}

@Override
public Bitmap getBitmap(String url) {
return cache.get(url);
}

@Override
public void putBitmap(String url, Bitmap bitmap) {
cache.put(url, bitmap);
}
}

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

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
break;
}
return super.onOptionsItemSelected(item);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
JCVideoPlayer videoController1, videoController2, videoController3;
Button btnToList, btnToListViewpager, btnToFullscreen, btnToChangecolor;
Button btnToList, btnToListViewpager, btnToFullscreen, btnToChangecolor, btnToLoadImage;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -46,11 +46,13 @@ protected void onCreate(Bundle savedInstanceState) {
btnToListViewpager = (Button) findViewById(R.id.to_list_viewpager_activity);
btnToFullscreen = (Button) findViewById(R.id.to_fullscreen);
btnToChangecolor = (Button) findViewById(R.id.to_changecolor_activity);
btnToLoadImage = (Button) findViewById(R.id.to_list_loadimage_activity);

btnToList.setOnClickListener(this);
btnToListViewpager.setOnClickListener(this);
btnToFullscreen.setOnClickListener(this);
btnToChangecolor.setOnClickListener(this);
btnToLoadImage.setOnClickListener(this);

JCVideoPlayer.setJcBuriedPoint(jcBuriedPoint);
}
Expand Down Expand Up @@ -157,6 +159,9 @@ public void onClick(View v) {
Toast.makeText(MainActivity.this, "coming soon", Toast.LENGTH_SHORT).show();
// startActivity(new Intent(this, SetSkinActivity.class));
break;
case R.id.to_list_loadimage_activity:
startActivity(new Intent(MainActivity.this, LoadImageActivity.class));
break;
}
}

Expand Down
76 changes: 76 additions & 0 deletions app/src/main/res/layout/activity_loadimage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="3dp"
tools:context="fm.jiecao.jiecaovideoplayer.MainActivity">

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="ImageLoader" />

<fm.jiecao.jcvideoplayer_lib.JCVideoPlayer
android:id="@+id/videocontroller1"
android:layout_width="match_parent"
android:layout_height="200dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="Glide" />

<fm.jiecao.jcvideoplayer_lib.JCVideoPlayer
android:id="@+id/videocontroller2"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="2dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="Picasso" />

<fm.jiecao.jcvideoplayer_lib.JCVideoPlayer
android:id="@+id/videocontroller3"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="2dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="Volley" />

<fm.jiecao.jcvideoplayer_lib.JCVideoPlayer
android:id="@+id/videocontroller4"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="2dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="Fresco not yet" />

</LinearLayout>
</ScrollView>

</LinearLayout>
6 changes: 6 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
android:layout_height="wrap_content"
android:text="List and Viewpager demo" />

<Button
android:id="@+id/to_list_loadimage_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Other load image library" />

</LinearLayout>
</ScrollView>

Expand Down
Binary file added downloads/jiecaovideoplayer-2.0-demo.apk
Binary file not shown.
Binary file added downloads/jiecaovideoplayer-2.0-javadoc.jar
Binary file not shown.
Binary file added downloads/jiecaovideoplayer-2.0-sources.jar
Binary file not shown.
Binary file added downloads/jiecaovideoplayer-2.0.aar
Binary file not shown.
Binary file removed downloads/jiecaovideoplayer-2.0_preview-demo.apk
Binary file not shown.
Binary file removed downloads/jiecaovideoplayer-2.0_preview-javadoc.jar
Binary file not shown.
Binary file not shown.
Binary file removed downloads/jiecaovideoplayer-2.0_preview.aar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/maven_push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ signing {

group = "fm.jiecao"
archivesBaseName = "jiecaovideoplayer"
version = "2.0_preview"
version = "2.0"

uploadArchives {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion jcvideoplayer-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
minSdkVersion 14
targetSdkVersion 23
versionCode 22
versionName "2.0_preview"
versionName "2.0"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ protected void onCreate(Bundle savedInstanceState) {
jcVideoPlayer.ivStart.performClick();
} else {
jcVideoPlayer.isFullscreenFromNormal = true;
jcVideoPlayer.addSurfaceView();
if (JCMediaManager.intance().listener != null) {
JCMediaManager.intance().listener.onCompletion();
}
JCMediaManager.intance().listener = jcVideoPlayer;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void onSeekComplete(MediaPlayer mp) {
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
if (listener != null) {
listener.onError();
listener.onError(what, extra);
}
return true;
}
Expand Down Expand Up @@ -114,7 +114,7 @@ interface JCMediaPlayerListener {

void onSeekComplete();

void onError();
void onError(int what, int extra);

void onVideoSizeChanged();

Expand Down
Loading

0 comments on commit 14675d9

Please sign in to comment.