externalott tv boxx怎么用

全店满100元或1台可混批采购
加入进货单Android VideoView Quality is so bad on TV Box using Vitamio Library [Android VideoView质量很差在电视盒使用Vitamio库] - 问题-字节技术
Android VideoView Quality is so bad on TV Box using Vitamio Library
Android VideoView质量很差在电视盒使用Vitamio库
问题 (Question)
Struggling to get a better quality for G-Box by implementing the Vitamio library for live Streaming.
A sample online Video URL having .mp4 video is used in code. but When we play it in Media player after downloading thats works fine and when i try it by online streaming the quality gets very poor.
following is the code for playing video on video View.
public class VideoViewDemo extends Activity {
* TODO: Set the path variable to a streaming video URL or a local media file
private String path = "";
private VideoView mVideoV
private ProgressDialog progD
ProgressDialog progressDialog=
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (!LibsChecker.checkVitamioLibs(this))
setContentView(R.layout.videoview);
mVideoView = (VideoView) findViewById(R.id.surface_view);
path = "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4";
if (path == "") {
// Tell the user to provide a media file URL/path.
Toast.makeText(VideoViewDemo.this, "Please edit
VideoViewDemo
Activity, and set path" +
" variable to your media file URL/path", Toast.LENGTH_LONG).show();
* Alternatively,for streaming media you can use
* mVideoView.setVideoURI(Uri.parse(URLstring));
mVideoView.setVideoPath(path);
mVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
progDailog = ProgressDialog.show(this, "Please wait ...",
"Retrieving data ...", true);
progDailog.setCancelable(true);
mVideoView.setOnPreparedListener(
new MediaPlayer.OnPreparedListener() {
public void onPrepared(MediaPlayer mediaPlayer) {
// optional need Vitamio 4.0
//mediaPlayer.setPlaybackSpeed(1.0f);
progDailog.dismiss();
mVideoView.setOnBufferingUpdateListener(
new OnBufferingUpdateListener() {
public void onBufferingUpdate(MediaPlayer arg0, int arg1) {
//mediaPlayer.setPlaybackSpeed(1.0f);
protected void onPause() {
mVideoView.pause();
super.onPause();
protected void onResume() {
mVideoView.resume();
progDailog.show();
super.onResume();
Your immediate response will help me a lot
努力得到更好的质量,通过实现直播的Vitamio图书馆礼盒。样品在线视频的URL。mp4视频中使用的代码。但当我们播放在媒体播放器下载这工作很好,当我试着通过在线流媒体质量变得很差。下面是玩视频视频视图的代码。 public class VideoViewDemo extends Activity {
* TODO: Set the path variable to a streaming video URL or a local media file
private String path = "";
private VideoView mVideoV
private ProgressDialog progD
ProgressDialog progressDialog=
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (!LibsChecker.checkVitamioLibs(this))
setContentView(R.layout.videoview);
mVideoView = (VideoView) findViewById(R.id.surface_view);
path = "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4";
if (path == "") {
// Tell the user to provide a media file URL/path.
Toast.makeText(VideoViewDemo.this, "Please edit
VideoViewDemo
Activity, and set path" +
" variable to your media file URL/path", Toast.LENGTH_LONG).show();
* Alternatively,for streaming media you can use
* mVideoView.setVideoURI(Uri.parse(URLstring));
mVideoView.setVideoPath(path);
mVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
progDailog = ProgressDialog.show(this, "Please wait ...",
"Retrieving data ...", true);
progDailog.setCancelable(true);
mVideoView.setOnPreparedListener(
new MediaPlayer.OnPreparedListener() {
public void onPrepared(MediaPlayer mediaPlayer) {
// optional need Vitamio 4.0
//mediaPlayer.setPlaybackSpeed(1.0f);
progDailog.dismiss();
mVideoView.setOnBufferingUpdateListener(
new OnBufferingUpdateListener() {
public void onBufferingUpdate(MediaPlayer arg0, int arg1) {
//mediaPlayer.setPlaybackSpeed(1.0f);
protected void onPause() {
mVideoView.pause();
super.onPause();
protected void onResume() {
mVideoView.resume();
progDailog.show();
super.onResume();
你的即时反应将帮助我很多
最佳答案 (Best Answer)
No doubt Vitamio is a very good Library covering all bugs related to video streaming.
Sorry to say but I am very much disappointed by Vitamio support team. I posted the Question on forum but not receive and feed back.
At last I find the solution of my problem by just making miner change on provided source.
enter code here@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (!LibsChecker.checkVitamioLibs(this))
setContentView(R.layout.mediaplayer_2);
mPreview = (SurfaceView) findViewById(R.id.surface);
holder = mPreview.getHolder();
holder.addCallback(this);
//holder.setFormat(PixelFormat.RGBA_8888);
holder.setFormat(PixelFormat.RGBX_8888);
extras = getIntent().getExtras();
private void playVideo(Integer Media) {
doCleanUp();
Log.e(TAG, "Value Received: " + Media);
switch (Media) {
case LOCAL_VIDEO:
* TODO: Set the path variable to a local media file path.
path = "";
path = Environment.getExternalStorageDirectory() + "/big_buck_bunny.mp4";
Log.e(TAG, "PATH = : " + path);
if (path == "") {
// Tell the user to provide a media file URL.
Toast.makeText(MediaPlayerDemo_Video.this, "Please edit MediaPlayerDemo_Video
Activity, " + "and set the path variable to your media file path."
+ " Your media file must be stored on sdcard.", Toast.LENGTH_LONG).show();
case STREAM_VIDEO:
* TODO: Set path variable to progressive streamable mp4 or
* 3gpp format URL. Http protocol should be used.
* Mediaplayer can only play "progressive streamable
* contents" which basically means: 1. the movie atom has to
* precede all the media data atoms. 2. The clip has to be
* reasonably interleaved.
path = "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4";
if (path == "") {
// Tell the user to provide a media file URL.
Toast.makeText(MediaPlayerDemo_Video.this, "Please edit MediaPlayerDemo_Video
Activity," + " and set the path variable to your media file URL.",
Toast.LENGTH_LONG).show();
// Create a new media player and set the listeners
mMediaPlayer = new MediaPlayer(this);
mMediaPlayer.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
mMediaPlayer.setDataSource(path);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
mMediaPlayer.getMetadata();
setVolumeControlStream
(AudioManager.STREAM_MUSIC);
//mMediaPlayer.setVideoQuality
(io.vov.vitamio.MediaPlayer.VIDEOQUALITY_HIGH);
} catch (Exception e) {
Log.e(TAG, "error: " + e.getMessage(), e);
There is a file in sample source with the name of “MediaPlayerDemo_Video.java”
Replace following line
holder.setFormat(PixelFormat.RGBA_8888);
With following
holder.setFormat(PixelFormat.RGBX_8888);
This will solve the entire problem.
Vitamio无疑是一个很好的图书馆涵盖所有与视频相关的bug。很抱歉,但是我非常失望了Vitamio支持团队。我在论坛上传了这个问题但不是接收和反馈。最后我找到我的问题的解决方案只是让矿工变化对提供来源。enter code here@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (!LibsChecker.checkVitamioLibs(this))
setContentView(R.layout.mediaplayer_2);
mPreview = (SurfaceView) findViewById(R.id.surface);
holder = mPreview.getHolder();
holder.addCallback(this);
//holder.setFormat(PixelFormat.RGBA_8888);
holder.setFormat(PixelFormat.RGBX_8888);
extras = getIntent().getExtras();
private void playVideo(Integer Media) {
doCleanUp();
Log.e(TAG, "Value Received: " + Media);
switch (Media) {
case LOCAL_VIDEO:
* TODO: Set the path variable to a local media file path.
path = "";
path = Environment.getExternalStorageDirectory() + "/big_buck_bunny.mp4";
Log.e(TAG, "PATH = : " + path);
if (path == "") {
// Tell the user to provide a media file URL.
Toast.makeText(MediaPlayerDemo_Video.this, "Please edit MediaPlayerDemo_Video
Activity, " + "and set the path variable to your media file path."
+ " Your media file must be stored on sdcard.", Toast.LENGTH_LONG).show();
case STREAM_VIDEO:
* TODO: Set path variable to progressive streamable mp4 or
* 3gpp format URL. Http protocol should be used.
* Mediaplayer can only play "progressive streamable
* contents" which basically means: 1. the movie atom has to
* precede all the media data atoms. 2. The clip has to be
* reasonably interleaved.
path = "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4";
if (path == "") {
// Tell the user to provide a media file URL.
Toast.makeText(MediaPlayerDemo_Video.this, "Please edit MediaPlayerDemo_Video
Activity," + " and set the path variable to your media file URL.",
Toast.LENGTH_LONG).show();
// Create a new media player and set the listeners
mMediaPlayer = new MediaPlayer(this);
mMediaPlayer.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
mMediaPlayer.setDataSource(path);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
mMediaPlayer.getMetadata();
setVolumeControlStream
(AudioManager.STREAM_MUSIC);
//mMediaPlayer.setVideoQuality
(io.vov.vitamio.MediaPlayer.VIDEOQUALITY_HIGH);
} catch (Exception e) {
Log.e(TAG, "error: " + e.getMessage(), e);
本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:USB2.0 TV BOXUSB2
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
USB2.0 TV BOX
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口

我要回帖

更多关于 android tv box怎么用 的文章

 

随机推荐