本文整理汇总了Java中android.widget.VideoView.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java VideoView.setVisibility方法的具体用法?Java VideoView.setVisibility怎么用?Java VideoView.setVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.VideoView
的用法示例。
在下文中一共展示了VideoView.setVisibility方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.VideoView; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected final void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContentView = new VideoView(this);
mContentView.setVisibility(View.GONE);
mContentView.setOnPreparedListener(new OnPreparedListener());
final FrameLayout.LayoutParams layoutParams =
new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT,
Gravity.CENTER);
mContentView.setLayoutParams(layoutParams);
setContentView(mContentView);
startEncode(new File(getFilesDir(), OUTPUT_FILE_NAME).getAbsolutePath());
}
示例2: go
import android.widget.VideoView; //导入方法依赖的package包/类
private void go() {
final ProgressBar p=(ProgressBar)findViewById(R.id.progressBar2);
VideoView v=(VideoView)findViewById(R.id.videoView2) ;
v.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
p.setVisibility(View.GONE);
}
});
String s="https://firebasestorage.googleapis.com/v0/b/lifesaver-18f28.appspot.com/o/earthquake.mp4?alt=media&token=98993371-823d-4b81-adc7-d9d87ec841a9";
Uri uri=Uri.parse(s);
v.setVideoURI(uri);
v.setVisibility(View.VISIBLE);
v.setVideoPath(s);
v.requestFocus();
v.start();
}
示例3: init
import android.widget.VideoView; //导入方法依赖的package包/类
private void init() {
ivPlay = (ImageView) findViewById(R.id.previre_play);
btDelete = (Button) findViewById(R.id.bt_cancel);
ivImage = (ImageView) findViewById(R.id.iv_image);
vvContent = (VideoView) findViewById(R.id.vv_content);
ivPlay.setOnClickListener(this);
btDelete.setOnClickListener(this);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
Bitmap bitmap = BitmapFactory.decodeFile(imagePath, options);
ivImage.setImageBitmap(bitmap);
if (videoPath.equals("")) {
ivPlay.setVisibility(View.GONE);
vvContent.setVisibility(View.GONE);
}
}
示例4: init
import android.widget.VideoView; //导入方法依赖的package包/类
private void init() {
ivPlay = (ImageView) findViewById(R.id.previre_play);
ivDelete = (ImageView) findViewById(R.id.bt_cancel);
ivPhoto = (ImageView) findViewById(R.id.iv_photo);
vvContent = (VideoView) findViewById(R.id.vv_content);
btNext = (Button) findViewById(R.id.bt_ok);
rlBottom = (RelativeLayout) findViewById(R.id.rl_bottom);
ivPlay.setOnClickListener(this);
ivDelete.setOnClickListener(this);
btNext.setOnClickListener(this);
ivPlay.setImageResource(previewPlayIcon);
ivDelete.setImageResource(previewTrashIcon);
rlBottom.setBackgroundColor(ContextCompat.getColor(this,themeColor));
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
Bitmap bitmap = BitmapFactory.decodeFile(imagePath, options);
ivPhoto.setImageBitmap(bitmap);
if (videoPath.equals("")) {
ivPlay.setVisibility(View.GONE);
vvContent.setVisibility(View.GONE);
}
}
示例5: init
import android.widget.VideoView; //导入方法依赖的package包/类
private void init() {
ivPlay = (ImageView) view.findViewById(R.id.previre_play);
ivDelete = (ImageView) view.findViewById(R.id.bt_cancel);
ivPhoto = (ImageView) view.findViewById(R.id.iv_photo);
vvContent = (VideoView) view.findViewById(R.id.vv_content);
btNext = (Button) view.findViewById(R.id.bt_ok);
rlBottom = (RelativeLayout) view.findViewById(R.id.rl_bottom);
ivPlay.setOnClickListener(this);
ivDelete.setOnClickListener(this);
btNext.setOnClickListener(this);
ivPlay.setImageResource(previewPlayIcon);
ivDelete.setImageResource(previewTrashIcon);
rlBottom.setBackgroundColor(ContextCompat.getColor(getActivity(),themeColor));
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
Bitmap bitmap = BitmapFactory.decodeFile(imagePath, options);
ivPhoto.setImageBitmap(bitmap);
if (videoPath.equals("")) {
ivPlay.setVisibility(View.GONE);
vvContent.setVisibility(View.GONE);
}
}
示例6: displayVideoThumbnail
import android.widget.VideoView; //导入方法依赖的package包/类
/**
* Switch from the video view to the video thumbnail
*
* @param view the page view
* @param display true to display the video thumbnail, false to display the video player
*/
private void displayVideoThumbnail(final View view, boolean display) {
final VideoView videoView = view.findViewById(R.id.media_slider_videoview);
final ImageView thumbView = view.findViewById(R.id.media_slider_video_thumbnail);
final ImageView playView = view.findViewById(R.id.media_slider_video_playView);
videoView.setVisibility(display ? View.GONE : View.VISIBLE);
thumbView.setVisibility(display ? View.VISIBLE : View.GONE);
playView.setVisibility(display ? View.VISIBLE : View.GONE);
}