newtaDev / pod_player

Video player for flutter web & mobile devices, Play video from youtube or vimeo or network in flutter using pod player
https://pub.dev/packages/pod_player
MIT License
106 stars 202 forks source link

Exeception : videoQuality cannot be empty (vimeo private videos) #226

Closed UrvishShaligram closed 1 month ago

UrvishShaligram commented 2 months ago

Here is my podplayercontroller for playing vimeo private videos :

late final controller = PodPlayerController( playVideoFrom: PlayVideoFrom.vimeoPrivateVideos("393556569", httpHeaders:{'Authorization': 'Bearer $token'}), podPlayerConfig: const PodPlayerConfig( isLooping: true,videoQualityPriority: [1080, 720, 360]), );

when I checkout the library code, the vimeoVideoUrls is empty and its coming from API , there is no parameter with the matching key written in library code, so library needs to update the code.

Anyone have any solution to solve this issue?

image

image

image

UllashPodder commented 2 months ago

I have played private videos using pod player for a client's project. I believe Vimeo's documentation is not detailed enough, this only works with Vimeo account with Pro account subscription. Free or starter accounts doesn't work. While creating the Vimeo app check private and video files

image
yashgandhishaligram commented 2 months ago

Here is the solution of this error, You just have to Generate New Personal Access Tokens with given Scopes in the Screenshot. Reference Link : https://help.vimeo.com/hc/en-us/articles/12427789081745-How-do-I-generate-a-personal-access-token Note : Do not forget to copy the new access token.

accestoken

Also, Initialize your PodPlayerController using below code in your app

String accessToken = 'YOURACCESSTOKEN';

late final controller = PodPlayerController( playVideoFrom: PlayVideoFrom.vimeoPrivateVideos(widget.video.url, httpHeaders:{'Authorization': 'Bearer $accessToken'}), podPlayerConfig: const PodPlayerConfig(autoPlay: false), );

Your vimeo private video will be played successfully.