Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vimeo API Error #212

Open
mfurkanyuceal opened this issue Jun 22, 2024 · 36 comments
Open

Vimeo API Error #212

mfurkanyuceal opened this issue Jun 22, 2024 · 36 comments

Comments

@mfurkanyuceal
Copy link

image

There is a problem with Vimeo videos. Videos cannot be played.
Flutter 3.22.2
Dart 3.4.3
pod_player: ^0.2.2

@panalgin
Copy link

I'm having the same problem

@chatali96
Copy link

flutter: ===== VIMEO API ERROR: FormatException: Unexpected character (at character 1)
flutter:
flutter: ^
flutter: ==========
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Unexpected character (at character 1)

@chatali96
Copy link

try {
final response = await _makeRequestHash(videoId, hash);
final jsonData =
jsonDecode(response.body)['request']['files']['progressive'];
}

      here progressive field is null thats why jsonData also null
      
      player is not able to play video anymore

@Jojo974
Copy link

Jojo974 commented Jun 26, 2024

I have had the same problem for several days

@panalgin
Copy link

see #182 , seems like vimeo closed unofficial /config endpoint for fetching video links

@Jefriluqman
Copy link

still same got the error

@Jefriluqman
Copy link

Screenshot 2024-07-03 at 1 56 47 PM
I receive this error

@Jefriluqman
Copy link

yes the video id is available on vimeo

@DkRocks25
Copy link

I am facing the same issue, It was working some days back but suddenly stopped working.

Please let me know if someone has found a fix as my app already in production.
Thanks.
Screenshot 2024-07-03 at 1 15 34 PM

@hgndgn
Copy link

hgndgn commented Jul 3, 2024

I'm also facing the same issue. I played private videos until last Monday. Now it doesn't work for either private or public Vimeo videos...

pod_player: 0.2.2
Flutter 3.19.2
Dart 3.3.0

@hgndgn
Copy link

hgndgn commented Jul 3, 2024

I am facing the same issue, It was working some days back but suddenly stopped working.
Please let me know if someone has found a fix as my app already in production. Thanks. Screenshot 2024-07-03 at 1 15 34 PM

this was the same issue i was facing. this issue is solved in my git url please remove first pod_player :^0.2.2 add like this in pubspec.yaml :

image

This doesn't work for me too. I get this error:

Cannot initialize video player: Exception: videoQuality cannot be empty #0

@warrenrodrigues
Copy link

I am facing the same issue, It was working some days back but suddenly stopped working.
Please let me know if someone has found a fix as my app already in production. Thanks. Screenshot 2024-07-03 at 1 15 34 PM

this was the same issue i was facing. this issue is solved in my git url please remove first pod_player :^0.2.2 add like this in pubspec.yaml :

image

That points to your forked repo of the project, where you have hard-coded a bearer token. This is not a long-term solution.

image

@hussainxaniar
Copy link

I'm having the same issue recently. the @anantnimbalkar solution is not working for me either.
I'll be looking into this issue to see if someone will find a working solution.

@ahsanfarooq6414
Copy link

Does anyone found any solution for this issue?
as I am fetching the videos and when I try to play video using videoId it gives above mentioned error I dont know what is the issue with this package.
Please any help in this regard will be a huge favor.

@hgndgn
Copy link

hgndgn commented Jul 5, 2024

First you need a personal access token, which you can generate in your app settings. Then fetch the video information using this request:

curl  -X GET \
  'https://api.vimeo.com/videos/<video-id>?fields=play' \
  --header 'Accept: application/vnd.vimeo.*+json;version=3.4' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <personal-access-token>'

You can then initialise the PodPlayer like this:

controller = PodPlayerController(
        playVideoFrom: PlayVideoFrom.networkQualityUrls(
          videoUrls: [
            VideoQalityUrls(quality: 360,  url: '<the link for 360p>),
          ],
        ),
      )..initialise()

@benja8151
Copy link

benja8151 commented Jul 6, 2024

First you need a personal access token, which you can generate in your app settings. Then fetch the video information using this request:

curl  -X GET \
  'https://api.vimeo.com/videos/<video-id>?fields=play' \
  --header 'Accept: application/vnd.vimeo.*+json;version=3.4' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <personal-access-token>'

You can then initialise the PodPlayer like this:

controller = PodPlayerController(
        playVideoFrom: PlayVideoFrom.networkQualityUrls(
          videoUrls: [
            VideoQalityUrls(quality: 360,  url: '<the link for 360p>),
          ],
        ),
      )..initialise()

Video links generated this way are only valid for 24 hours, so we would need to add requests to retrieve video links inside the app.

@ahsanfarooq6414
Copy link

I am fetching videos in this function:
Future<List> fetchVimeoVideos() async {
final String vimeoAccessToken = 'access token';

// Construct the API request URL
final String apiUrl = 'https://api.vimeo.com/me/videos?sort=date&direction=asc';

// Set the headers, including the access token
final headers = {
'Authorization': 'Bearer $vimeoAccessToken',
'Content-Type': 'application/json',
'Accept': 'application/vnd.vimeo.*+json;version=3.4'
};

// Send the HTTP GET request
final response = await http.get(Uri.parse(apiUrl), headers: headers);

// Check if the request was successful
if (response.statusCode == 200) {
// Parse the response body
final jsonResponse = jsonDecode(response.body);
// Return the list of videos
return jsonResponse['data'];
} else {
// Request failed, handle the error
throw Exception('Failed to fetch Vimeo videos: ${response.statusCode}');
}
}
and after fetching videos I pas video id to podplayer:
openVimeoPlayer(video['uri'].split('/').last);
can you please tell what things do I need to change?

@hgndgn
Copy link

hgndgn commented Jul 8, 2024

First you need a personal access token, which you can generate in your app settings. Then fetch the video information using this request:

curl  -X GET \
  'https://api.vimeo.com/videos/<video-id>?fields=play' \
  --header 'Accept: application/vnd.vimeo.*+json;version=3.4' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <personal-access-token>'

You can then initialise the PodPlayer like this:

controller = PodPlayerController(
        playVideoFrom: PlayVideoFrom.networkQualityUrls(
          videoUrls: [
            VideoQalityUrls(quality: 360,  url: '<the link for 360p>),
          ],
        ),
      )..initialise()

Video links generated this way are only valid for 24 hours, so we would need to add requests to retrieve video links inside the app.

@benja8151 Would you suggest any other/better solution?

@benja8151
Copy link

benja8151 commented Jul 8, 2024

@benja8151 Would you suggest any other/better solution?

No, at a glance I think this solution should work, but you need to fetch video links (your curl request) on demand inside the app, parse response and add them to videoUrls as you suggested.

@JAYTARPARA
Copy link

JAYTARPARA commented Jul 8, 2024

First you need a personal access token, which you can generate in your app settings. Then fetch the video information using this request:

curl  -X GET \
  'https://api.vimeo.com/videos/<video-id>?fields=play' \
  --header 'Accept: application/vnd.vimeo.*+json;version=3.4' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <personal-access-token>'

You can then initialise the PodPlayer like this:

controller = PodPlayerController(
        playVideoFrom: PlayVideoFrom.networkQualityUrls(
          videoUrls: [
            VideoQalityUrls(quality: 360,  url: '<the link for 360p>),
          ],
        ),
      )..initialise()

Why I am just getting status and not other things in API response. ? Any help would be appreciated.

@hgndgn
Copy link

hgndgn commented Jul 8, 2024

First you need a personal access token, which you can generate in your app settings. Then fetch the video information using this request:

curl  -X GET \
  'https://api.vimeo.com/videos/<video-id>?fields=play' \
  --header 'Accept: application/vnd.vimeo.*+json;version=3.4' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <personal-access-token>'

You can then initialise the PodPlayer like this:

controller = PodPlayerController(
        playVideoFrom: PlayVideoFrom.networkQualityUrls(
          videoUrls: [
            VideoQalityUrls(quality: 360,  url: '<the link for 360p>),
          ],
        ),
      )..initialise()

Why I am just getting status and not other things in API response. ? Any help would be appreciated.

@JAYTARPARA It can depend on the scope of your token. You can also remove the header "field=play" and see how the complete response looks like. And dude do not share your access token here :)

@JAYTARPARA
Copy link

First you need a personal access token, which you can generate in your app settings. Then fetch the video information using this request:

curl  -X GET \
  'https://api.vimeo.com/videos/<video-id>?fields=play' \
  --header 'Accept: application/vnd.vimeo.*+json;version=3.4' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <personal-access-token>'

You can then initialise the PodPlayer like this:

controller = PodPlayerController(
        playVideoFrom: PlayVideoFrom.networkQualityUrls(
          videoUrls: [
            VideoQalityUrls(quality: 360,  url: '<the link for 360p>),
          ],
        ),
      )..initialise()

image
Why I am just getting status and not other things in API response. ? Any help would be appreciated.

@JAYTARPARA It can depend on the scope of your token. You can also remove the header "field=play" and see how the complete response looks like. And dude do not share your access token here :)

What should be the scope? Can you please let me know. I have removed the screenshot.

@hgndgn
Copy link

hgndgn commented Jul 8, 2024

First you need a personal access token, which you can generate in your app settings. Then fetch the video information using this request:

curl  -X GET \
  'https://api.vimeo.com/videos/<video-id>?fields=play' \
  --header 'Accept: application/vnd.vimeo.*+json;version=3.4' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <personal-access-token>'

You can then initialise the PodPlayer like this:

controller = PodPlayerController(
        playVideoFrom: PlayVideoFrom.networkQualityUrls(
          videoUrls: [
            VideoQalityUrls(quality: 360,  url: '<the link for 360p>),
          ],
        ),
      )..initialise()

image
Why I am just getting status and not other things in API response. ? Any help would be appreciated.

@JAYTARPARA It can depend on the scope of your token. You can also remove the header "field=play" and see how the complete response looks like. And dude do not share your access token here :)

What should be the scope? Can you please let me know. I have removed the screenshot.

It depends on your needs. For example, I have these:

image

@Aman8996622
Copy link

hi @JAYTARPARA hi done the same thing but it doesn't working can any tell me correct solution of it

@mfurkanyuceal
Copy link
Author

@hgndgn It doesn't work with the same settings.

Screenshot 2024-07-14 at 12 29 36
Screenshot 2024-07-14 at 12 28 15

There is no video link in the response returned.

@hgndgn
Copy link

hgndgn commented Jul 14, 2024

@mfurkanyuceal My videos are "Unlisted". Maybe therefore it works for me, I could check it later.

@mfurkanyuceal
Copy link
Author

@mfurkanyuceal My videos are "Unlisted". Maybe therefore it works for me, I could check it later.

I set it the same way but it didn't work. Could your Vimeo pricing plan be different?

@hgndgn
Copy link

hgndgn commented Jul 14, 2024

@mfurkanyuceal Yes it could be. I have a "Pro Plan".

@mfurkanyuceal
Copy link
Author

@mfurkanyuceal Yes it could be. I have a "Pro Plan".

Thank you. If the payment plan is a plus, we can say that it does not work.

@mfurkanyuceal
Copy link
Author

@hgndgn Thanks for the solution. When I join the Pro payment plan, I can get the links of the videos using the vimeo API. I have no problems with Android. However, I encountered the "Error while playing video" error on iOS. Do you have any relevant experience with this error?

image

          podPlayerController = PodPlayerController(
            playVideoFrom: PlayVideoFrom.network(
              vimeoVideoLink!,
              videoPlayerOptions: VideoPlayerOptions(
                allowBackgroundPlayback: true,
              ),
            ),
            podPlayerConfig: const PodPlayerConfig(
              autoPlay: false,
              isLooping: false,
              wakelockEnabled: true,
            ),
          )..initialise();
                                    AspectRatio(
                                      aspectRatio: 16 / 9,
                                      child: PodVideoPlayer(
                                        controller: trainerProfileController.podPlayerController!,
                                        videoAspectRatio: 16 / 9,
                                      ),
                                    ),

@chathuranga1992
Copy link

@hgndgn It doesn't work with the same settings.

Screenshot 2024-07-14 at 12 29 36 Screenshot 2024-07-14 at 12 28 15

There is no video link in the response returned.

this is happening to me when Unlisted URL's apart from my Vimeo account. For My account's Unlisted videos getting all Progressive,hls & dash sections
Screenshot 2024-08-22 at 08 12 20
Screenshot 2024-08-22 at 08 13 15

@nikunjshaligram
Copy link

podPlayerController = PodPlayerController(
playVideoFrom: PlayVideoFrom.network(
vimeoVideoLink!,
videoPlayerOptions: VideoPlayerOptions(
allowBackgroundPlayback: true,
),
),
podPlayerConfig: const PodPlayerConfig(
autoPlay: false,
isLooping: false,
wakelockEnabled: true,
),
)..initialise();

      I am using this code but not work in android and ios. Is there any solution for vimeo url play a video?

@chathuranga1992
Copy link

podPlayerController = PodPlayerController( playVideoFrom: PlayVideoFrom.network( vimeoVideoLink!, videoPlayerOptions: VideoPlayerOptions( allowBackgroundPlayback: true, ), ), podPlayerConfig: const PodPlayerConfig( autoPlay: false, isLooping: false, wakelockEnabled: true, ), )..initialise();

      I am using this code but not work in android and ios. Is there any solution for vimeo url play a video?

you have to get personal access token from your vimeo developer console to get streaming data according to above discussion.

@nikunjshaligram
Copy link

I have to found this error, so how to resolved :

Initialization error: Exception: videoQuality cannot be empty

@Kingofalltimes
Copy link

Has anyone found a solution for this Vimeo player issue?

@mohamed-belal1
Copy link

I have the same issue, how can there's no solution to play vimeo videos in flutter...

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

No branches or pull requests