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/v4.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathen committed Oct 23, 2016
2 parents 7e80b62 + e9535ba commit 3531183
Show file tree
Hide file tree
Showing 29 changed files with 422 additions and 227 deletions.
12 changes: 6 additions & 6 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
<p align="center">
<a href="http://developer.android.com/index.html"><img src="https://img.shields.io/badge/platform-android-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C4.6.3%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-4.7.0_preview-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C4.6.3%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-4.8.0-green.svg"></a>
<a href="http://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/license-MIT-green.svg"></a>
<a href="https://android-arsenal.com/details/1/3269"><img src="https://img.shields.io/badge/Android%20Arsenal-jiecaovideoplayer-green.svg?style=true"></a>
</p>
Expand All @@ -22,22 +22,22 @@

##效果

**[jiecaovideoplayer-4.7.0_preview-demo.apk](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.7.0_preview_Preview/jiecaovideoplayer-4.7.0_preview-demo.apk)**
**[jiecaovideoplayer-4.8.0-demo.apk](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.8.0/jiecaovideoplayer-4.8.0.apk)**

![Demo Screenshot][1]

##使用

1.添加类库,这个版本的目的是预览自动进入小窗功能,不要用在生产环境,稳定版本仍然是v4.6.5
```gradle
compile 'fm.jiecao:jiecaovideoplayer:4.7.0_preview'
compile 'fm.jiecao:jiecaovideoplayer:4.8.0'
```

或直接下载

* [jiecaovideoplayer-4.7.0_preview.aar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/4.7.0_preview/jiecaovideoplayer-4.7.0_preview.aar)
* [jiecaovideoplayer-4.7.0_preview-javadoc.jar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/4.7.0_preview/jiecaovideoplayer-4.7.0_preview-javadoc.jar)
* [jiecaovideoplayer-4.7.0_preview-sources.jar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/4.7.0_preview/jiecaovideoplayer-4.7.0_preview-sources.jar)
* [jiecaovideoplayer-4.8.0.aar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.8.0/jiecaovideoplayer-4.8.0.aar)
* [jiecaovideoplayer-4.8.0-javadoc.jar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.8.0/jiecaovideoplayer-4.8.0-javadoc.jar)
* [jiecaovideoplayer-4.8.0-sources.jar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.8.0/jiecaovideoplayer-4.8.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
Expand Up @@ -2,7 +2,7 @@
--
<p align="center">
<a href="http://developer.android.com/index.html"><img src="https://img.shields.io/badge/platform-android-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C4.6.3%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-4.7.0_preview-green.svg"></a>
<a href="http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C4.6.3%7Caar"><img src="https://img.shields.io/badge/Maven%20Central-4.8.0-green.svg"></a>
<a href="http://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/license-MIT-green.svg"></a>
<a href="https://android-arsenal.com/details/1/3269"><img src="https://img.shields.io/badge/Android%20Arsenal-jiecaovideoplayer-green.svg?style=true"></a>
</p>
Expand All @@ -28,22 +28,22 @@ Ambition is become the most widely used video playback control.

## Effect

**[jiecaovideoplayer-4.7.0_preview-demo.apk](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.7.0_preview_Preview/jiecaovideoplayer-4.7.0_preview-demo.apk)**
**[jiecaovideoplayer-4.8.0-demo.apk](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.8.0/jiecaovideoplayer-4.8.0.apk)**

![Demo Screenshot][1]

## Usage

1.Import library,new feature auto tiny window is not perfect this version, do not use it in you project, this is juct preview the feature , Stable version is still v4.6.5
```gradle
compile 'fm.jiecao:jiecaovideoplayer:4.7.0_preview'
compile 'fm.jiecao:jiecaovideoplayer:4.8.0'
```

Or download lib

* [jiecaovideoplayer-4.7.0_preview.aar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/4.7.0_preview/jiecaovideoplayer-4.7.0_preview.aar)
* [jiecaovideoplayer-4.7.0_preview-javadoc.jar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/4.7.0_preview/jiecaovideoplayer-4.7.0_preview-javadoc.jar)
* [jiecaovideoplayer-4.7.0_preview-sources.jar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/4.7.0_preview/jiecaovideoplayer-4.7.0_preview-sources.jar)
* [jiecaovideoplayer-4.8.0.aar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.8.0/jiecaovideoplayer-4.8.0.aar)
* [jiecaovideoplayer-4.8.0-javadoc.jar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.8.0/jiecaovideoplayer-4.8.0-javadoc.jar)
* [jiecaovideoplayer-4.8.0-sources.jar](https://github.com/lipangit/JieCaoVideoPlayer/releases/download/v4.8.0/jiecaovideoplayer-4.8.0-sources.jar)

2.Add JCVideoPlayer in your layout
```xml
Expand Down
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 14
targetSdkVersion 24
versionCode 43
versionName "4.7.1_preview"
versionCode 44
versionName "4.8.0"
}
buildTypes {
release {
Expand Down
21 changes: 19 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:configChanges="orientation"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand All @@ -23,43 +23,60 @@

<activity
android:name=".PlayDirectlyActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>

<activity
android:name=".ListViewActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".ListViewNormalActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".ListViewViewpagerActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".ListViewMultiHolderActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>

<activity
android:name=".UIActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".UISmallChangeActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".UIBigChangeActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".UIImageLoaderActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".RecyclerViewNormalActivity"/>
android:name=".RecyclerViewNormalActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".AutoTinyActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".AutoTinyListActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".AutoTinyNormalActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"/>
<activity
android:name=".WebViewActivity"
android:screenOrientation="portrait"/>

</application>
Expand Down
23 changes: 23 additions & 0 deletions app/src/main/assets/jcvd.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<body>
<div class="content"></div>
<div id="cont" style="width:100%;height:200px">
</div>
<div style="height:100px"></div>
<h3 style="width:100%;text-align:center">This is webview</h3>
<div style="height:700px"></div>
<div id="cont1" style="width:65%;height:200px;float:right;">
</div>
<div style="height:800px"></div>
<script>
var cont=document.getElementById("cont");
jcvd.adViewJieCaoVideoPlayer(-1,200,0,0)
<!--jcvd.adViewJieCaoVideoPlayer(cont1.width,cont1.height,cont1.offsetTop,cont1.offsetLeft)-->

var cont1=document.getElementById("cont1");
jcvd.adViewJieCaoVideoPlayer(210,120,cont1.offsetTop,cont1.offsetLeft)

</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.widget.ListView;
import android.widget.TextView;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.squareup.picasso.Picasso;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;
Expand Down Expand Up @@ -70,7 +69,9 @@ public long getItemId(int position) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
//This is the point

if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof VideoHolder) {
((VideoHolder) convertView.getTag()).jcVideoPlayer.release();
}
if (getItemViewType(position) == 1) {
VideoHolder viewHolder;
if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof VideoHolder) {
Expand All @@ -82,14 +83,13 @@ public View getView(int position, View convertView, ViewGroup parent) {
convertView.setTag(viewHolder);
}

boolean setUp = viewHolder.jcVideoPlayer.setUp(
viewHolder.jcVideoPlayer.setUp(
VideoConstant.videoUrls[position], JCVideoPlayer.SCREEN_LAYOUT_LIST,
VideoConstant.videoTitles[position]);
if (setUp) {

Picasso.with(ListViewMultiHolderActivity.this)
.load(VideoConstant.videoThumbs[position])
.into(viewHolder.jcVideoPlayer.thumbImageView);
}
} else {
TextViewHolder textViewHolder;
if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof TextViewHolder) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package fm.jiecao.jiecaovideoplayer;

import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.widget.AbsListView;
import android.widget.ListView;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;
Expand All @@ -16,6 +17,9 @@ public class ListViewNormalActivity extends AppCompatActivity {
ListView listView;
VideoListAdapter adapterVideoList;

SensorManager sensorManager;
JCVideoPlayer.JCAutoFullscreenListener sensorEventListener;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -29,6 +33,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
listView = (ListView) findViewById(R.id.listview);
adapterVideoList = new VideoListAdapter(this);
listView.setAdapter(adapterVideoList);

sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
sensorEventListener = new JCVideoPlayer.JCAutoFullscreenListener();
}

@Override
Expand All @@ -39,9 +46,17 @@ public void onBackPressed() {
super.onBackPressed();
}

@Override
protected void onResume() {
super.onResume();
Sensor accelerometerSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
sensorManager.registerListener(sensorEventListener, accelerometerSensor, SensorManager.SENSOR_DELAY_NORMAL);
}

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

Expand Down
57 changes: 30 additions & 27 deletions app/src/main/java/fm/jiecao/jiecaovideoplayer/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.view.View;
import android.widget.Button;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.squareup.picasso.Picasso;

import fm.jiecao.jcvideoplayer_lib.JCBuriedPoint;
Expand All @@ -24,59 +23,60 @@
*/
public class MainActivity extends AppCompatActivity implements View.OnClickListener {

JCVideoPlayer.JCAutoFullscreenListener sensorEventListener;
SensorManager sensorManager;
JCVideoPlayer.JCAutoFullscreenListener mSensorEventListener;
SensorManager mSensorManager;


JCVideoPlayerStandard jcVideoPlayerStandard;
JCVideoPlayerSimple jcVideoPlayerSimple;
JCVideoPlayerStandard mJcVideoPlayerStandard;
JCVideoPlayerSimple mJcVideoPlayerSimple;

Button tinyWindow, autoTinyWindow, aboutListView, aboutUI, playDirectly;
Button mTinyWindow, mAutoTinyWindow, mAboutListView, mAboutUI, mPlayDirectly;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

tinyWindow = (Button) findViewById(R.id.tiny_window);
autoTinyWindow = (Button) findViewById(R.id.auto_tiny_window);
aboutUI = (Button) findViewById(R.id.play_directly_without_layout);
aboutListView = (Button) findViewById(R.id.about_listview);
playDirectly = (Button) findViewById(R.id.about_ui);
mTinyWindow = (Button) findViewById(R.id.tiny_window);
mAutoTinyWindow = (Button) findViewById(R.id.auto_tiny_window);
mAboutUI = (Button) findViewById(R.id.play_directly_without_layout);
mAboutListView = (Button) findViewById(R.id.about_listview);
mPlayDirectly = (Button) findViewById(R.id.about_ui);

tinyWindow.setOnClickListener(this);
autoTinyWindow.setOnClickListener(this);
aboutListView.setOnClickListener(this);
aboutUI.setOnClickListener(this);
playDirectly.setOnClickListener(this);
mTinyWindow.setOnClickListener(this);
mAutoTinyWindow.setOnClickListener(this);
mAboutListView.setOnClickListener(this);
mAboutUI.setOnClickListener(this);
mPlayDirectly.setOnClickListener(this);

jcVideoPlayerSimple = (JCVideoPlayerSimple) findViewById(R.id.simple_demo);
jcVideoPlayerSimple.setUp("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"
mJcVideoPlayerSimple = (JCVideoPlayerSimple) findViewById(R.id.simple_demo);
mJcVideoPlayerSimple.setUp("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"
, JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "嫂子在家吗");

jcVideoPlayerStandard = (JCVideoPlayerStandard) findViewById(R.id.jc_video);
jcVideoPlayerStandard.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4"
mJcVideoPlayerStandard = (JCVideoPlayerStandard) findViewById(R.id.jc_video);
mJcVideoPlayerStandard.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4"
, JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "嫂子坐这");
Picasso.with(this)
.load("http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1458036374.jpg")
.into(jcVideoPlayerStandard.thumbImageView);
.into(mJcVideoPlayerStandard.thumbImageView);
// mJcVideoPlayerStandard.setLoop(true);

JCVideoPlayer.setJcBuriedPoint(new MyJCBuriedPointStandard());
sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
sensorEventListener = new JCVideoPlayer.JCAutoFullscreenListener();
mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
mSensorEventListener = new JCVideoPlayer.JCAutoFullscreenListener();
}

@Override
protected void onResume() {
super.onResume();
Sensor accelerometerSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
sensorManager.registerListener(sensorEventListener, accelerometerSensor, SensorManager.SENSOR_DELAY_NORMAL);
Sensor accelerometerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
mSensorManager.registerListener(mSensorEventListener, accelerometerSensor, SensorManager.SENSOR_DELAY_NORMAL);
}

@Override
protected void onPause() {
super.onPause();
sensorManager.unregisterListener(sensorEventListener);
mSensorManager.unregisterListener(mSensorEventListener);
JCVideoPlayer.releaseAllVideos();
}

Expand All @@ -92,7 +92,7 @@ public void onBackPressed() {
public void onClick(View v) {
switch (v.getId()) {
case R.id.tiny_window:
jcVideoPlayerStandard.startWindowTiny();
mJcVideoPlayerStandard.startWindowTiny();
break;
case R.id.auto_tiny_window:
startActivity(new Intent(MainActivity.this, AutoTinyActivity.class));
Expand All @@ -106,6 +106,9 @@ public void onClick(View v) {
case R.id.about_ui:
startActivity(new Intent(MainActivity.this, UIActivity.class));
break;
case R.id.about_webview:
startActivity(new Intent(MainActivity.this, WebViewActivity.class));
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
public void onBindViewHolder(MyViewHolder holder, int position) {
Log.i(TAG, "onBindViewHolder [" + holder.jcVideoPlayer.hashCode() + "] position=" + position);

boolean setUp = holder.jcVideoPlayer.setUp(
holder.jcVideoPlayer.setUp(
VideoConstant.videoUrls[position], JCVideoPlayer.SCREEN_LAYOUT_LIST,
VideoConstant.videoTitles[position]);
if (setUp) {
Picasso.with(holder.jcVideoPlayer.getContext())
.load(VideoConstant.videoThumbs[position])
.into(holder.jcVideoPlayer.thumbImageView);
}

}

@Override
Expand Down
Loading

0 comments on commit 3531183

Please sign in to comment.