question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting null from video.getPlay()

See original GitHub issue

I successfully get a Video instance from fetchNetworkContent but then I get null when invoking video.getPlay().

String accessToken = getString(R.string.vimeo_access_token);
Configuration.Builder configBuilder = new Configuration.Builder(accessToken);
VimeoClient.initialize(configBuilder.build());

VimeoClient.getInstance().fetchNetworkContent(uri, new ModelCallback<Video>(Video.class) {
    @Override
    public void success(Video video) {
        // I successfully get here , but play is null.
        Play play = video.getPlay();
        if (play != null) {
            VideoFile hlsFile = play.getHlsVideoFile();
            String hlsLink = hlsFile.getLink();
            initializePlayer(Uri.parse(hlsLink));
        }
    }

    @Override
    public void failure(VimeoError error) {
        ...
    }
});

I am using a token which I created from My Apps with my Vimeo Account. I am expecting to get some result from play so I can get the hls link of the video.

I am following all the requesites the documentation ask to get video files.

  1. User must be logged in. (I am using a valid token which I create in my app)
  2. User must be the owner of the video. (I am the owner of the video I am asking for)
  3. User must be PRO or higher (or the app must have the “can access owner’s video files” capability). (My account is PRO, I can even get this link from vimeo playground)
  4. Token must have the video_files scope. (My token has the video_files scope, actually I tried with all the scopes on but did not work)
  5. User must be the owner of the API app making the request. (The app is mine that I created using the same account)

Trying for two days, how to solve this issue?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
soonsam123commented, Oct 26, 2018

Thank you for your attention. Actually, I am getting hls link like this.

ArrayList<VideoFile> videoFiles = video.files;
if (videoFiles != null && !videoFiles.isEmpty()) {
    VideoFile videoFile = videoFiles.get(videoFiles.size() - 1);
    String hlsLink = videoFile.getLink();
}

I tried it in more than 30 videos already and it is working. I am still not 100% sure but I think Hsl link is always the last in the array and there is always a hls link.

1reaction
MrTheGoodcommented, Oct 25, 2018

Yes, video.files will only be removed in a future update. I recommend fixing the API version to the current version (3.4 I think?) just so that the app doesn’t suddenly break.

There is a way to get the hls link, but I don’t remember how I did it. You’d have to look into the library source code to find that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vimeo API Video.getPlay always returns null - Stack Overflow
video.getDownload() works and gives me an array of 3. I use the same access token that I used to upload the video. I...
Read more >
getPixels() returning null using ofVideoPlayer - beginners ...
I'm having incredibly painful problems loading frames of a video into a vector called eventFrames. I have pasted the whole function below, and...
Read more >
VideoPlayer GetTexture returns null - Community | MonoGame
I'm just trying to play an mp4 video in my game, but GetTexture always returns null no matter what. Surely mp4 is supported?...
Read more >
Video.js Setup
If there is no player matching the argument, it will attempt to create one. Using videojs.getPlayer(). Sometimes, you want to get a reference...
Read more >
Player Catalog - Brightcove Player Documentation
The catalog's library makes it easy to get information on Video Cloud media and load them into ... If no error occurs, this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found