Chúng tôi có nhà cung cấp cung cấp cho chúng tôi các tệp m3u8 cho luồng HLS (ban đầu được dự định để sử dụng trong ứng dụng iOS).HLS (http phát trực tuyến) trên Android 3.0 và tìm kiếm
Android 3.0+ hỗ trợ phát trực tuyến http (http://developer.android.com/guide/appendix/media-formats.html) - và thực tế, chúng tôi có thể phát các tệp m3u8 này bằng cách sử dụng VideoView chuẩn trên Android 3.0+ .
EDIT: Android dường như coi đây là nguồn cấp dữ liệu video "thời gian thực" và vô hiệu hóa khả năng tìm kiếm hoặc tính thời lượng video. (Ở đâu-như iOS cho phép bạn tìm kiếm trong luồng mà không có vấn đề)
Có cách nào để buộc android 3.0+ tìm kiếm trong các tệp này không?
Dưới đây là một hoạt động mẫu cho những người khác để thử nghiệm với:
import android.app.Activity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class SandboxActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView vw = (VideoView) findViewById(R.id.videoView);
vw.setVideoPath("http://devimages.apple.com/iphone/samples/bipbop/gear4/prog_index.m3u8");
vw.setMediaController(new MediaController(this));
vw.requestFocus();
vw.start();
}
}
và bố cục mẫu:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center" android:id="@+id/root">
<VideoView
android:id="@+id/videoView"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</RelativeLayout>
này đang sử dụng liên kết mẫu HLS từ Apple.
Bạn có tìm thấy giải pháp cho vấn đề này không? –
Tôi cũng muốn triển khai tìm kiếm trong luồng trực tiếp của HLS. Bạn đã tìm thấy giải pháp nào chưa? –