Android 버전 2.1,2.2,2.3,2.3.6 및 4.0을 사용하는 기기를 사용해 보았습니다. vitamio 응용 프로그램은 Android 4.0 버전의 장치 HTC onex를 제외한 모든 장치에서 5 ~ 6 초 동안 URL을 스트리밍 할 수 있습니다.
간단한 m3u8 url을 호출하는 코드가 아래에 주어져 있습니다. 많은 분들께 감사드립니다.
활동 :
package com.livestrean;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.MediaController;
import android.widget.Toast;
import android.widget.VideoView;
public class streamplayer extends Activity {
/** Called when the activity is first created. */
private String path = "An m3u8 Url";
private VideoView mVideoView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try
{
setContentView(R.layout.surface_view_1);
mVideoView = (VideoView) findViewById(R.id.surface_view);
mVideoView.setVideoURI(Uri.parse(path));
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.postInvalidateDelayed(100);
mVideoView.start();
}catch (Exception e) {
Toast.makeText(streamplayer.this,"Error Occured:- " + e.getMessage(),Toast.LENGTH_SHORT).show();
}
}
}
레이아웃 :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<VideoView
android:id="@+id/surface_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"/>
</LinearLayout>
감사
HLS는 API 레벨이 앱을 구축하는 데 사용할 무엇 안드로이드 2.3.3 (API 레벨 10), 이후 지원 ? vitamio도 HLS 용 Android 2.1 이상이 필요합니다. – yorkw
안녕하세요, 자세히 설명해 주시겠습니까? 나는 또한 vitamioBundle도 사용했고 같은 문제가 발생했습니다. 내장 장치 : Samsung Galaxy Tab 7 ", 버전 2.2.1 개발 도구 : 대상 SDK : Android 4.3, Min SDK : 8. 감사합니다. –