Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

I'm not getting files of video, always been getting nil for even public videos #435

Open
kiramikacan opened this issue Apr 9, 2021 · 1 comment

Comments

@kiramikacan
Copy link

I need to get .mp4 url of a Vimeo video, I'm using PlayerKit sdk in iOS, we have a pro Vimeo account, I'm using video request endpoint of VimeoNetworking sdk, endpoint returns me a VIMVideo object but the "Files" field always being nil.

Here is my code:

    let appConfiguration = AppConfiguration( clientIdentifier: "myIdentifier", clientSecret: "mySecret", scopes: [.Public, .Private, .Interact], keychainService: "")
    
    let vimeoClient = VimeoClient(appConfiguration: appConfiguration, configureSessionManagerBlock: nil)
    
    let authenticationController = AuthenticationController(client: vimeoClient, appConfiguration: appConfiguration, configureSessionManagerBlock: nil)
    
    authenticationController.accessToken(token: "myAccessToken") { result in
        switch result
        {
        case .success(let account):
            print("authenticated successfully: \(account)")
            
            let videoRequest = Request<VIMVideo>(path: "/videos/534313082")
            
            _ = vimeoClient.request(videoRequest) { (result) in
                switch result {
                case .success(let response):
                    let video: VIMVideo = response.model
                    print("retrieved video: \(video)")
                case .failure(let error):
                    print("error retrieving video: \(error)")
                }
            }
            
        case .failure(let error):
            print("failure authenticating: \(error)")
        }
    }

and here is the returned vimvideo object:

Screen Shot 2021-04-09 at 09 53 17

What am I doing wrong here?

@vvdodiya
Copy link

Try this code to get video file.
let videoFiles = VideoRequest.videoRequest(forVideoURI: "me/videos/534313082") _ = VimeoClient.defaultClient.request(videoFiles) { (result) in switch result { case .success(result: let videoInf): print(videoInf.model.files) case .failure(error: let error): print(error) } }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants