我正在使用vitamio库来传输m3u8格式。我写了这些代码。它正在运行。
public class MainActivity extends Activity {
private Button baslat;
private Button durdur;
private VideoView videoView;
private String httpLiveUrl = "http://strm-l.glb.mncdn.net/kaybedenlerkulubu/live/playlist.m3u8";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.setTitle("Standart FM");
baslat = (Button) findViewById(R.id.buttonBasla);
durdur = (Button) findViewById(R.id.buttonDurdur);
videoView = (VideoView)findViewById(R.id.VideoView);
baslat.setEnabled(true);
durdur.setEnabled(true);
if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
return;
videoView.setVideoURI(Uri.parse(httpLiveUrl));
baslat.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
MediaController mediaController = new MediaController(getApplicationContext());
videoView.setMediaController(mediaController);
//videoView.requestFocus();
videoView.start();
}
});
durdur.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
durdur.setEnabled(false);
// Buraya stream i durdurma yazılacak
}
});
}
当我点击baslat按钮时,我听到只有刮擦声音。这是我的logcat发现。
07-22 09:00:55.031: D/Vitamio[Player](539): 106977
07-22 09:00:55.031: I/Vitamio[Player](539): META AUDIO: 0. 106977, META SUBTITLE:
07-22 09:00:55.031: D/Vitamio[Player](539): FIND CODEC_ID 86018
07-22 09:00:55.031: I/Vitamio[Player](539): OOPS: ONLY 1
07-22 09:00:55.081: D/Vitamio[Player](539): OPEN CODEC aac
07-22 09:00:55.081: I/Vitamio[Player](539): OPEN STREAM AUDIO BEGIN
07-22 09:00:55.081: I/Vitamio[Player](539): Copyright (c) VOV IO (http://vov.io).
07-22 09:00:55.081: I/Vitamio[Player](539): THIS SOFTWARE (Vitamio) IS WORK OF VOV IO (http://vov.io)
07-22 09:00:55.091: I/Vitamio[Player](539): Application package name: com.applogist.standartfmproject
07-22 09:00:55.091: I/Vitamio[Player](539): 2, 44100, 0
07-22 09:00:55.100: I/Vitamio[Player](539): OPEN STREAM AUDIO END
07-22 09:00:55.100: D/Vitamio[Player](539): CLEAN START
07-22 09:00:55.100: D/Vitamio[Player](539): prepared
07-22 09:00:55.111: D/Vitamio(539): onPrepared
07-22 09:00:55.111: D/Vitamio[Player](539): start
07-22 09:00:55.130: D/Vitamio[Player](539): THREAD AUDIO_DECODE START
07-22 09:00:55.141: D/Vitamio[Player](539): CLEAN END
07-22 09:00:55.141: I/Vitamio[Player](539): THREAD PREPARE DETTACHED
07-22 09:00:55.151: D/Vitamio[Player](539): THREAD AUDIO_OUTPUT START
07-22 09:00:55.151: I/Vitamio[Player](539): THREAD PREPARE END
07-22 09:00:55.161: D/Vitamio[Player](539): THREAD DEMUX START
07-22 09:00:55.181: I/Vitamio(539): Info (701, 0)
07-22 09:00:55.181: D/Vitamio(539): onInfo: (701, 0)
07-22 09:00:55.181: D/Vitamio[Player](539): stop
07-22 09:00:55.191: I/Vitamio(539): Info (901, 0)
07-22 09:00:55.191: D/Vitamio(539): onInfo: (901, 0)
07-22 09:01:05.124: I/Vitamio(539): Info (901, 36)
07-22 09:01:05.124: D/Vitamio(539): onInfo: (901, 36)
我试过2.3和4.0设备。但我听到了同样的声音。刮。我能解决这个问题吗?