vimeo-networking-java icon indicating copy to clipboard operation
vimeo-networking-java copied to clipboard

What should be the field filter to get play links?

Open Cosmopal opened this issue 2 years ago • 1 comments

Summary

The documentation strongly recommends applying field filters to reduce the amount of data we get back, but it doesn't explain the video output schema. What should the field filters be if we want to get the HLS/DASH links of a video we own?

The documentation only suggests:

vimeoApiClient.fetchVideo(
  uri = uri,
  fieldFilter = null,
  queryParams = null,
  cacheControl = null,
  callback = vimeoCallback(
    onSuccess = {
      // Use the video.
    },
    onError = {
      // Voice the error.
    }
  )
) 

and then

val dashLink: String? = video.play?.dash?.link
val hlsLink: String? = video.play?.hls?.link

Cosmopal avatar Mar 16 '22 20:03 Cosmopal

The field filters directly map to the JSON name in the annotation applied to each property. So for example, video.play?.dash?.link wants the link in the dash property in the play property. Looking at the JSON annotations, you need to use play.dash.link as your field filter. Since you also want the HLS link, you need to add play.hls.link as well. So your full field filter is play.dash.link,play.hls.link. Hope that makes sense.

anthonycr avatar Mar 21 '22 21:03 anthonycr