使用视频查看Android视频流媒体(视频图中未显示automatially) [英] Android Video Streaming using Video View (video view not showing automatially)

查看:137
本文介绍了使用视频查看Android视频流媒体(视频图中未显示automatially)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功地流使用视频观看互联网视频

I have managed to stream video from internet using Video View

  Uri uri=Uri.parse(videoFileList[0]);
    VideoView vv=(VideoView) this.findViewById(R.id.vv);

    vv.setVisibility(1);
    vv.bringToFront();
    vv.setVideoURI(uri);        
    vv.setMediaController(new MediaController(this));
    vv.requestFocus();

但视频页面显示为空白在第一。只有当我点击空白处视频​​查看会出现大。

But the video page displays as blank at first. Only if I click on the blank space the video view appeares.

任何机构可以提供一个解决方案,以自动显示呢?

Can any body give a solution to display it automatically?

推荐答案

试试这个。它为我工作。

Try this. It worked for me.

void playvideo(String url) 
{
    String  link=url;
    Log.e("url",link);
    view1 = (VideoView) findViewById(R.id.myVideoView); 
    getWindow().setFormat(PixelFormat.TRANSLUCENT);
    MediaController mc = new MediaController(this); 
    mc.setMediaPlayer(view1); 
    view1.setMediaController(mc); 
    view1.setVideoURI(Uri.parse(link)); 
    view1.requestFocus(); 
    view1.start();
}

这篇关于使用视频查看Android视频流媒体(视频图中未显示automatially)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆