Something went wrong. Try again later

wcarle

Hello down there!

447 54 26 112
Forum Posts Wiki Points Following Followers

New API Endpoints for Video!

We have some awesome new API endpoints for video that just went live. One for getting running livestreams, and one for getting and setting video progress!

New APIs for Livestreams and Video Progress

We have two new video endpoints we've released for you developers to start testing:

Livestream Endpoint:

Want to know when a livestream is up and get the HLS (.m3u8) stream URL for broadcast in your app? Here's how!

Just make a GET request to this here URL!

Note: You'll need the user's API key (this is a premium only feed) So you'll need your user to complete the app auth flow, more info on that here

http://www.giantbomb.com/api/video/current-live/?api_key=<API Key>

This will return a result containing the live stream info (if there is a livestream currently running):

{

"success": 1,

"video": {

"title": "Dev Test Chat",

"image": "static.giantbomb.com/uploads/original/23/233047/2911522-friday-jason03.jpg",

"stream": "https://cbsigameslive2-lh.akamaihd.net/i/upf011317jvh_1@37386/master.m3u8?set-segment-duration=responsive"

}

}

Video Saved Progress for Third Party Apps:

You know those cool little bars under the video image that tell you where you left off in the video?

No Caption Provided

You can now send time data to our API to sync the time codes your users left off on.

Save Time For Video:

GET or POST: http://www.giantbomb.com/api/video/save-time/?video_id=<ID_OF_VIDEO>&time_to_save=<TIME_IN_SECONDS>&api_key=<USERS_API_KEY>

Retrieve Saved Time For Video:

GET: http://www.giantbomb.com/api/video/get-saved-time/?video_id=<ID_OF_VIDEO>&api_key=<USERS_API_KEY>

Result:

{

"success": 1,

"savedTime": "1516"

}

You can use these APIs to get the user's synced time from the site and submit your own, so a user can start watching the video on the site, continue where they left off on your app, then come back to the site to finish it later!

As a best practice I would recommend only calling the save-time endpoint only every 5 seconds or so, let's not send a billion requests to our servers as the user watches a video :)

If you have any problems or questions about these APIs please let me know! We'll be updating the official API docs with this info once we have all the problems sorted out!

Happy Programming!

20 Comments