Extend media Type with variants property #44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To be able to fetch the videos direct URL, we need the
variants
field and aVariant
model.Right now, you can only get a twitter URL of the media, but not of the video resource as well. Crucial part to be able to play the video in your app.
More details on this link
https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/media
That page is not fully up to date tho.
I joined a Twitter Chirp slack where I asked about fetching video/gif URL and got info that this is now possible (on the link it still says "Note that video URLs are not currently available, only static images.") 😅
Tested this in a playground here:
playground
@daneden , I hope this makes sense 🙌