Zype offers an API endpoint that enables you to download a video file for offline playback or distribution. This feature is especially useful for making content available when internet connectivity may be limited. The downloadable version is usually an MP4 file (unlike the HLS manifests used for streaming), making it compatible with most devices and players.
Prerequisites
• Video ID: The video_id for the specific content you wish to download.
• Player API Key: The player API Key can be found in the Developer Section in the settings menu
Downloading a Video for Offline Playback
To obtain a downloadable version of the video, use the Player API request. This will provide a JSON response with a download URL.
API Request:
curl --request GET \
--url 'https://player.zype.com/embed/{video_id}.json?download=true&api_key={player_api_key}' \
--header 'accept: application/json'
- Replace {video_id} with the actual ID of the video you wish to download.
- Replace the {player_api_key} with the player API Key.
- Use .json after the vide_id as format.
- The download=true parameter is required to access the downloadable MP4 version.
- Be sure to include the accept: application/json header to receive the response in JSON format.
Response Structure
The response from this API request includes the download URL for the video file as well as all the metadata for the video. Here’s a simplified version of the response:
{
"response": {
"body": {
"outputs": [
{
"url": "https://your-video-url.mp4",
"type": "mp4",
"name": "mp4",
"height": 1080,
"width": 1920,
"bitrate": 5600
}
],
"files": [
{
"url": "https://your-video-url.mp4",
"type": "mp4",
"name": "mp4",
"height": 1080,
"width": 1920,
"bitrate": 5600
}
],
"on_air": false,
"analytics": {
.....
}
},
"subtitles": []
},
"video": {
"_id": "video_id",
"title": "Video Title",
"duration": 653,
"description": "Video description here.",
"created_at": "2024-05-23T08:02:09.731-04:00",
"categories": [
{"title": "Genre", "value": ["Animation"]}
],
"thumbnails": [
{
"url": "https://thumbnail-url.jpg",
"width": 1920,
"height": 1080
}
],
"custom_attributes": {
"my_custom_attribute": "my_custom_value"
}
....
}
}
....
}
Defining the Downloadable Versions’ Resolution and Quality
The quality and resolution of the downloadable versions are based on the transcode profile assigned to the video. By default, Zype generates a single 480p MP4 as the downloadable version. However, you can configure this to create higher-resolution options if required.
Important Note: The downloadable file obtained via this API request is a transcoded MP4 version designed for offline playback or distribution and does not include the mezzanine (originally uploaded) file.
Was this article helpful?
Articles in this section
- How to Download a Video for Offline Playback Using the Zype API
- Integrating a Custom Video Player via API
- Create zobjects with custom attributes using the API
- Creating New Subscriptions with the API
- Assigning Categories to Videos Using the API
- Using the Upload API Endpoint
- Ad Timings with the API
- Importing a Single Video from a URL
- How to Merge a New Video Import to an Existing Video Using the API
- How to Request a Video Player