【问题标题】:ExoPlayer in Android TV using Kotlin使用 Kotlin 的 Android TV 中的 ExoPlayer
【发布时间】:2018-12-27 11:46:27
【问题描述】:

如何使用 ExoPlayer 库流式传输 m3u8 文件并在 Android TV 上播放。 我只想构建一个基本的视频播放器来在 Android TV 上播放 m3u8 文件。

我使用的库是这样的:ExoPlayer

【问题讨论】:

    标签: kotlin android-tv m3u8 exoplayer


    【解决方案1】:

    使用来自ExoMedia Sample 的 emVideoView.setVideoURI

    private VideoView videoView;
    
    private void setupVideoView() {
        // Make sure to use the correct VideoView import
        videoView = (VideoView)findViewById(R.id.video_view);
        videoView.setOnPreparedListener(this);
    
        //For now we just picked an arbitrary item to play
        videoView.setVideoURI(Uri.parse("https://archive.org/download/Popeye_forPresident/Popeye_forPresident_512kb.mp4"));
    }
    
    @Override
    public void onPrepared() {
        //Starts the video playback as soon as it is ready
        videoView.start();
    }
    

    其他参考,SO post

    【讨论】:

      猜你喜欢
      • 2018-08-15
      • 2020-08-23
      • 2016-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-25
      • 1970-01-01
      相关资源
      最近更新 更多