This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<video width="1280" height="720" controls> | |
<!-- The source files used below are the mp4_720p and webm_720p output URLs provided by the SYNQ details API --> | |
<source src="https://multicdn.synq.fm/projects/fb/ec/fbec62099ed94d7ba7692c1234567891/derivatives/videos/3a/b5/3ab5226012e4483aa653b31234567891/mp4_720/3ab5226012e4483aa653b31234567891_mp4_720.mp4" type="video/mp4"> | |
<source src="https://multicdn.synq.fm/projects/fb/ec/fbec62099ed94d7ba7692c1234567891/derivatives/videos/3a/b5/3ab5226012e4483aa653b31234567891/webm_720/3ab5226012e4483aa653b31234567891_webm_720.webm" type="video/webm"> | |
Your browser does not support HTML5 video. | |
</video> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample Details API JSON output | |
{ | |
"input": { | |
"url": "https://multicdn.synq.fm/projects/fb/ec/fbec62099ed94d7ba7692c1234567891/uploads/videos/3a/b5/3ab5226012e4483aa653b31234567891.mp4", | |
"width": 3840, | |
"height": 2160, | |
"duration": 471.304, | |
"file_size": 238726667, | |
"framerate": 29.97, | |
"uploaded_at": "2017-05-30T23:03:57.012Z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//userdata query find all every where year is 2017 and the model name is c | |
if (video.userdata.cars) | |
{ | |
if (video.userdata.cars[0]["year"] == 2017 && | |
_.includes(video.userdata.cars[0].models, "c")) | |
{ | |
return {"id":video.video_id, "cars_userdata": video.userdata.cars} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this call will modify year from above to be 2017 | |
video.userdata.cars[0]["year"]=2017 | |
//this call will add the model 'slk' to the above sample | |
video.userdata.cars[0]["models"].push("slk") | |
//sample body response from Update API after above calls | |
{ | |
"state": "created", | |
"userdata": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//if using the Create API, to create an array of cars put this into 'userdata' field | |
{"cars": [{"make":"mercedes","year":2013, "models":["c","cls"]}]} | |
//if using the Update API, to create an array of cars put this in the 'source' field | |
video.userdata = {"cars": [{"make":"mercedes","year":2013, "models":["c","cls"]}]} | |
//sample body response from Update or Create API: | |
{ | |
"state": "created", | |
"userdata": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* search videos that have player views greater than 9000 and return the all the information for the videos that match | |
the query */ | |
if (video.get("player.views") > 9000) { return video } | |
//search videos that have been uploaded and return only the video id | |
if (video.state == 'uploaded') { return {"video_id": video.video_id}; } | |
/* search videos that have been uploaded and where player views is greater than 1, return only the video id and | |
player embed url */ | |
if (video.state == 'uploaded' && video.get("player.views") >= 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<video width="640" height="360" controls> | |
<source src="video_url.mp4" type="video/mp4"> | |
<source src="video_url.webm" type="video/webm"> | |
Your browser does not support HTML5 video. | |
</video> |
NewerOlder