簡體   English   中英

直播 Android(http 或 httplive)

[英]Live Streaming Android (http or httplive)

有沒有人在 android 設備上運行 http 直播(由 Apple 發現)。 我有一些流媒體 Url。 像 "" www.abc/iphone/france24/allegro/fr/f24_fr.m3u8 "" 類型。 我的任務是為 android 3.0 OS 類型的移動設備制作應用程序。 任何人都可以幫我完成它。

該主題是android市場上的新主題。因此在互聯網上沒有太多幫助。 我有一個示例代碼可以在 android 設備上運行直播。但它沒有運行我擁有的網址。 這些 url 在 IPAD 或 IPHONE 上有效。 謝謝

查看 android 錯誤報告中的問題 用 httplive 替換 http 對我有用。 以下是錯誤報告中的示例代碼

private void playVideo(Integer Media) {
    doCleanUp();
    try {
        switch (Media) {
            case Globals.TEST_HTTP:
                path = "http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
                break;
            case Globals.TEST_HTTPLIVE:
                path = "httplive://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
                break;
        }
        mMediaPlayer = new MediaPlayer();
        mMediaPlayer.setDataSource(path);
        mMediaPlayer.setDisplay(holder);
        mMediaPlayer.prepare();
        mMediaPlayer.setOnBufferingUpdateListener(this);
        mMediaPlayer.setOnCompletionListener(this);
        mMediaPlayer.setOnPreparedListener(this);
        mMediaPlayer.setOnVideoSizeChangedListener(this);
        mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    } catch (Exception e) {
        Log.e(TAG, "error: " + e.getMessage(), e);
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM