我正在嘗試開發基於Android的應用程序,該應用程序可以從直播視頻播放視頻。此直播流使用Wowza Media Server製作。在Android應用程序中播放RTSP流媒體
的網址是:
rtsp://tv.hindiworldtv.com:1935/live/getpun
我試圖按照ecliplse代碼:
package com.kalloh.wpa;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Bundle;
import android.view.Window;
import android.widget.MediaController;
import android.widget.VideoView;
public class a extends Activity {
VideoView videoView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
//Create a VideoView widget in the layout file
//use setContentView method to set content of the activity to the layout file which contains videoView
this.setContentView(R.layout.videoplayer);
videoView = (VideoView)this.findViewById(R.id.videoView);
//add controls to a MediaPlayer like play, pause.
MediaController mc = new MediaController(this);
videoView.setMediaController(mc);
//Set the path of Video or URI
videoView.setVideoURI(Uri.parse("rtsp://tv.hindiworldtv.com:1935/live/getpnj"));
//
//Set the focus
videoView.requestFocus();
}
}
起初,它不能正常工作。
現在開始工作,但在20到30秒後停止。我該如何解決這個問題?
我有使用vlc相同的問題,並在這裏找到了一些東西(這不是解決方案,但有幫助的信息):http://code.google.com/p/android/issues/detail?id=15229 – hungson175
現在給定的網址正在Android 4及以上..但仍然是問題是音頻不連續。這是2秒後播放延遲1秒.. – SJSSoft
你如何解決這個問題? –