Acquiring File Preview Stream or making a Preview Playlist
AnsweredI'm trying to figure out if this is possible with the Box API. I don't see anything in the documentation that suggest it is.
From playing with Box when working with video files I see that a lower bitrate/resolution stream is available in the preview. Great!
I want to do something similar using the Box API. My users will upload several videos , using my UI they will specify some order for them to generate a playlist, and then I want them to see how their playlist looks. If I use the Playlist API it returns a URI that can be displayed in an IFRAME to show a video preview of a single file on box. Is there someway to either
- Produce a Preview window that will automatically continue to another video among a list of videos
- Acquire a URI to the reduced bitrate preview stream
Thanks.
-
Hello! Try taking a look at our representations API, which allows you to work directly with converted representations of a file: https://developer.box.com/reference#representations
Fetching the exact low-res video representation you see in the Box web application won't be straight forward since we use the MPEG-DASH protocol (https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP) and an open source library called Shaka Player (https://github.com/google/shaka-player) to fetch and play DASH segments. However, you should be able to leverage the simple MP4 representation, which should be 480p by sending an X-Rep-Hints value of [mp4] (see the documentation for how to use X-Rep-Hints).
Please sign in to leave a comment.
Comments
1 comment