提交 363e3ab7 编写于 作者: S shuyu

add test

上级 21e9a19e
......@@ -18,6 +18,7 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.example.gsyvideoplayer.utils.CommonUtil;
import com.example.gsyvideoplayer.utils.JumpUtils;
import com.example.gsyvideoplayer.video.MultiSampleVideo;
import com.example.gsyvideoplayer.video.SampleControlVideo;
import com.shuyu.gsyvideoplayer.GSYBaseActivityDetail;
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
......@@ -55,7 +56,7 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
NestedScrollView postDetailNestedScroll;
@BindView(R.id.detail_player)
SampleControlVideo detailPlayer;
MultiSampleVideo multiSampleVideo;
@BindView(R.id.activity_detail_player)
RelativeLayout activityDetailPlayer;
......@@ -101,7 +102,7 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
initGifHelper();
detailPlayer.setLockClickListener(new LockClickListener() {
multiSampleVideo.setLockClickListener(new LockClickListener() {
@Override
public void onClick(View view, boolean lock) {
//if (orientationUtils != null) {
......@@ -167,7 +168,7 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
@Override
public StandardGSYVideoPlayer getGSYVideoPlayer() {
return detailPlayer;
return multiSampleVideo;
}
@Override
......@@ -178,6 +179,8 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
return new GSYVideoOptionBuilder()
.setThumbImageView(imageView)
.setUrl(url)
.setPlayTag(hashCode() + "f")
.setPlayPosition(hashCode())
.setCacheWithPlay(true)
.setVideoTitle(" ")
.setIsTouchWiget(true)
......@@ -199,6 +202,10 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
mGifCreateHelper.cancelTask();
}
@Override
protected void onResume() {
super.onResume();
}
/*******************************竖屏全屏开始************************************/
......@@ -244,14 +251,14 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
/*******************************竖屏全屏结束************************************/
private void initGifHelper() {
mGifCreateHelper = new GifCreateHelper(detailPlayer, new GSYVideoGifSaveListener() {
mGifCreateHelper = new GifCreateHelper(multiSampleVideo, new GSYVideoGifSaveListener() {
@Override
public void result(boolean success, File file) {
detailPlayer.post(new Runnable() {
multiSampleVideo.post(new Runnable() {
@Override
public void run() {
loadingView.setVisibility(View.GONE);
Toast.makeText(detailPlayer.getContext(), "创建成功", Toast.LENGTH_LONG).show();
Toast.makeText(multiSampleVideo.getContext(), "创建成功", Toast.LENGTH_LONG).show();
}
});
}
......@@ -318,7 +325,7 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
@NeedsPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void shotImage(final View v) {
//获取截图
detailPlayer.taskShotPic(new GSYVideoShotListener() {
multiSampleVideo.taskShotPic(new GSYVideoShotListener() {
@Override
public void getBitmap(Bitmap bitmap) {
if (bitmap != null) {
......@@ -357,8 +364,8 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
private void resolveNormalVideoUI() {
//增加title
detailPlayer.getTitleTextView().setVisibility(View.GONE);
detailPlayer.getBackButton().setVisibility(View.GONE);
multiSampleVideo.getTitleTextView().setVisibility(View.GONE);
multiSampleVideo.getBackButton().setVisibility(View.GONE);
}
/**
......@@ -378,12 +385,12 @@ public class DetailControlActivity extends GSYBaseActivityDetail<StandardGSYVide
speed = 1;
}
changeSpeed.setText("播放速度:" + speed);
detailPlayer.setSpeedPlaying(speed, true);
multiSampleVideo.setSpeedPlaying(speed, true);
}
private void showToast(final String tip) {
detailPlayer.post(new Runnable() {
multiSampleVideo.post(new Runnable() {
@Override
public void run() {
Toast.makeText(DetailControlActivity.this, tip, Toast.LENGTH_LONG).show();
......
package com.example.gsyvideoplayer;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import androidx.core.widget.NestedScrollView;
......@@ -21,6 +22,7 @@ import com.shuyu.gsyvideoplayer.utils.Debuger;
import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
......@@ -254,7 +256,10 @@ public class DetailPlayer extends AppCompatActivity {
//String url = "http://video.7k.cn/app_video/20171202/6c8cf3ea/v.m3u8.mp4";
//String url = "http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8";
String url = "http://wdquan-space.b0.upaiyun.com/VIDEO/2018/11/22/ae0645396048_hls_time10.m3u8";
//String url = "http://wdquan-space.b0.upaiyun.com/VIDEO/2018/11/22/ae0645396048_hls_time10.m3u8";
//String url = "videosgz.etwyy.com/UploadFile/Video/道路运输防御性驾驶和不安全驾驶习惯纠正之五.flv";
String url = "http://videosgz.etwyy.com/UploadFile/Video/" + URLEncoder.encode("道路运输防御性驾驶和不安全驾驶习惯纠正之五") + ".flv";
Debuger.printfError(url);
//String url = "https://cdn61.ytbbs.tv/cn/tv/55550/55550-1/play.m3u8?md5=v4sI4lWlo4XojzeAjgBGaQ&expires=1521204012&token=55550";
//String url = "http://1253492636.vod2.myqcloud.com/2e5fc148vodgzp1253492636/d08af82d4564972819086152830/plHZZoSkje0A.mp4";
......
......@@ -29,7 +29,7 @@
</androidx.core.widget.NestedScrollView>
<com.example.gsyvideoplayer.video.SampleControlVideo
<com.example.gsyvideoplayer.video.MultiSampleVideo
android:id="@+id/detail_player"
android:layout_width="match_parent"
android:layout_height="@dimen/post_media_height" />
......
......@@ -93,7 +93,7 @@ public abstract class GSYBaseActivityDetail<T extends GSYBaseVideoPlayer> extend
@Override
protected void onResume() {
super.onResume();
getGSYVideoPlayer().getCurrentPlayer().onVideoResume();
//getGSYVideoPlayer().getCurrentPlayer().onVideoResume();
if (orientationUtils != null) {
orientationUtils.setIsPause(false);
}
......
......@@ -35,7 +35,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//api project(':gsyVideoPlayer-java')
api project(':gsyVideoPlayer-java')
//api project(':gsyVideoPlayer-exo_player2')
//api project(':gsyVideoPlayer-armv5')
//api project(':gsyVideoPlayer-armv7a')
......@@ -48,7 +48,7 @@ dependencies {
//api "com.shuyu:GSYVideoPlayer:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion"
//api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion"
api "com.shuyu:GSYVideoPlayer-exo2:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-armv5:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-armv7a:$gsyVideoVersion"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册