使用视频查看器的最佳方式。并播放视频
有什么方法可以在不使用 uri 的情况下播放存储在原始文件中的视频。如果不是,我该如何正确设置 uri。假设我有一个名为电影的文件,我想用视频查看器播放它。我该怎么做?我还必须将数据写入 SD 卡吗?或者我可以直接从原始版本开始播放吗?
为什么我不能这样做
uri uri.parse("android.resources://"+this.getApplicationContext().getPackageName()+movie);
这就是我现在所拥有的,如果你可以的话,你可以向我指出错误,这样我就知道了,我不会再遇到这个问题了
VideoView videoview = (VideoView) findViewById(R.id.videoView1);
videoview.setKeepScreenOn(true);
videoview.setVideoPath("android.raw://com.example.movievp8");
MediaController controller = new MediaController(videoview.getContext());
videoview.setMediaController(controller);
videoview.start();
videoview.requestFocus();
Is there any way I can play a video that has been stored in the raw file, without the use of the uri. If not how do i properly set the uri. Let's say i have file named movie and I want to play it with a videoviewer. How would i do this? Also would i have to write the data to the sd card. or can i just play it from the raw.
Why cant I just do
uri uri.parse("android.resources://"+this.getApplicationContext().getPackageName()+movie);
This is what I have it as now if you could can you point out the errors to me so i know and i wont have to have this problem any more
VideoView videoview = (VideoView) findViewById(R.id.videoView1);
videoview.setKeepScreenOn(true);
videoview.setVideoPath("android.raw://com.example.movievp8");
MediaController controller = new MediaController(videoview.getContext());
videoview.setMediaController(controller);
videoview.start();
videoview.requestFocus();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是对我有用的东西:
Here is something that works for me: