当前位置: 首页>>代码示例>>Java>>正文


Java VideoView.setVisibility方法代码示例

本文整理汇总了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());
}
 
开发者ID:Nik-Gleb,项目名称:mpeg-encoder,代码行数:21,代码来源:MainActivity.java

示例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();





    }
 
开发者ID:iamjaspreetsingh,项目名称:LifeSaver,代码行数:23,代码来源:Main3Activity.java

示例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);
    }
}
 
开发者ID:aynurkacak,项目名称:Touch-to-record-Camera,代码行数:20,代码来源:PreviewActivity.java

示例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);
    }
}
 
开发者ID:aynurkacak,项目名称:bullseye,代码行数:27,代码来源:PreviewActivity.java

示例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);
    }
}
 
开发者ID:aynurkacak,项目名称:bullseye,代码行数:27,代码来源:PreviewFragment.java

示例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);
}
 
开发者ID:vector-im,项目名称:riot-android,代码行数:16,代码来源:VectorMediasViewerAdapter.java


注:本文中的android.widget.VideoView.setVisibility方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。