我正在尝试将实时视频从Spydriod流式传输到Vitamio中的视频视图。它是在VLC palyer上流媒体,但当我在vitamio上尝试时,我看到的只是一个黑屏。我已经搜索了互联网并尝试了许多解决方案,但没有真正解决问题。以下是我访问过的链接。
https://github.com/yixia/VitamioBundle/issues/18
Can't run live stream using Vitamio
Integration of Vitamio in Android App
LogFile中也没有错误。以下是我主要活动的代码。
mainactivity.java
package com.example.sidraaleem.project;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import java.util.HashMap;
import io.vov.vitamio.LibsChecker;
import io.vov.vitamio.MediaPlayer;
import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;
public class MainActivity extends ActionBarActivity {
private static final String TAG = "MainActivity";
private String path;
//private HashMap<String, String> options;
private VideoView mVideoView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mVideoView = (VideoView) findViewById(R.id.vitamio_videoView);
if (LibsChecker.checkVitamioLibs(this)) //it will check the include library of Vitamio
return;
path = "rtsp://192.168.1.2:8086";
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mediaPlayer.setPlaybackSpeed(1.0f);
}
});
}
}
同样在manifest.xml中,我添加了下述权限。
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
但事实证明并没有结果。请帮助我,我完全陷入了这个问题。