use of com.yiw.circledemo.widgets.videolist.target.VideoProgressTarget in project CircleDemo by Naoki2015.
the class CircleVideoView method init.
private void init() {
inflate(getContext(), R.layout.layout_video, this);
videoPlayer = (TextureVideoView) findViewById(R.id.video_player);
videoFrame = (ImageView) findViewById(R.id.iv_video_frame);
videoProgress = (CircularProgressBar) findViewById(R.id.video_progress);
videoButton = (ImageView) findViewById(R.id.iv_video_play);
videoTarget = new VideoLoadTarget(this);
progressTarget = new VideoProgressTarget(videoTarget, videoProgress);
videoPlayer.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (videoPlayer.isPlaying()) {
videoPlayer.stop();
}
}
});
videoButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(videoUrl)) {
Toast.makeText(getContext(), "video url is empty...", Toast.LENGTH_LONG).show();
return;
}
// load video file
videoState = STATE_ACTIVED;
progressTarget.start();
Glide.with(getContext()).using(VideoListGlideModule.getOkHttpUrlLoader(), InputStream.class).load(new GlideUrl(videoUrl)).as(File.class).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(progressTarget);
videoButton.setVisibility(View.INVISIBLE);
if (onPlayClickListener != null) {
onPlayClickListener.onPlayClick(postion);
}
}
});
}
Aggregations