0

I'm working with the Pac-12 API (college sports data) and trying to make a streaming video player.

The Pac-12 API (http://api.pac-12.com/v3/vod?page=0") gives back a list of video objects with urls for their Video's on Demand (VODs).

I have exo player set up in Android and it's working for videos with urls that end in .mp4.

But when I try to plug in the VOD urls it's giving an error that it cannot extract the file type.

I'm using exo player 2.8.4 which may or may not be the problem. But the newer version of exo player ( 2.9.0 and above ) has min sdk 26 (which my testing phone doesn't run).

I'm working on checking if that's the problem, but in the mean time I wanted to post this question in case anyone can help.

Here is my exo player set up. mediaUrl is the varaible that works with .mp4 but not the VOD url.


 DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(
                context, Util.getUserAgent(context, "RecyclerView VideoPlayer"));
        String mediaUrl = mediaObjects.get(targetPosition).getMedia_url();
        if (mediaUrl != null) {
            MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
                    .createMediaSource(Uri.parse(mediaUrl));
            videoPlayer.prepare(videoSource);
            videoPlayer.setPlayWhenReady(true);
        }

The VOD urls give no file type extension at the end, so I tried concatenating '.vod' onto the mediaUrl varaible, but no luck with that.

From reading around online it seems like VODs are supported by exo player, but I can't find much about how the setup might be different.

Heres a direct link to one of the Pac-12 VODs. This is the same url as what the API returns.

https://pac-12.com/videos/oregons-dana-altman-talks-andy-katz-about-recruitment-getting-fans-back-and-more

Louis Sankey
  • 481
  • 8
  • 26
  • 1
    That appears to be a link to a Web page, not to a video. Looking at the JSON from the API, the `manifest_url` looks more promising than does the `url`. Or, perhaps the plan is that you would use something from `youtube_ids` to assemble a YouTube URL. – CommonsWare Jul 03 '21 at 21:26
  • Yes, that's what I was thinking. Maybe I'm missing something on their API documentation https://pac12v3.docs.apiary.io/# but that's what gets returned when I query a VOD – Louis Sankey Jul 03 '21 at 21:29
  • Looks promising. And there is more info online about how to set up exo with .m3u8 files. Appreciated! – Louis Sankey Jul 03 '21 at 21:40

0 Answers0