Using the SimpleStream API you can get a list of all of your files, and get information of each individual file.
Returns a list of files in JSON format.
https://simplestream.netlify.app/api/files?key=account_key
Name | Description | Required | Type |
---|---|---|---|
Your account key, which you use to login. | Yes | String |
200
Content-Type: application/json
[{
"name": "4K.mp4",
"id": "JK2FK2cndx"
}, {
"name": "Big_Buck_Bunny_1080_10s_1MB.mp4",
"id": "69kPmN2k6M"
}, {
"name": "[123876] 9.mp4",
"id": "Eby818mcPx"
}, {
"name": "meta",
"id": ""
}]
Returns information about the specified file in JSON format.
https://simplestream.netlify.app/api/file?key=account_key&id=video_id
Name | Description | Required | Type |
---|---|---|---|
Your account key, which you use to login. | Yes | String | |
The id of the file. | Yes | String |
200
Content-Type: application/json
{
"name": "4K.mp4",
"id": "B35Ph8IhAB",
"account_key": "123"
}
Using the SimpleStream API you can get a list of all of your files, and get information of each individual file.
Returns a list of files in JSON format.
https://simplestream.netlify.app/api/files?key=account_key
Name | Description | Required | Type |
---|---|---|---|
Your account key, which you use to login. | Yes | String |
200
Content-Type: application/json
[{
"name": "4K.mp4",
"id": "JK2FK2cndx"
}, {
"name": "Big_Buck_Bunny_1080_10s_1MB.mp4",
"id": "69kPmN2k6M"
}, {
"name": "[123876] 9.mp4",
"id": "Eby818mcPx"
}, {
"name": "meta",
"id": ""
}]
Using the SimpleStream API you can create Watch2Gether rooms so two or more people can watch a video at the same time.
Returns the room link for the room admin and viewers. Each room expires after 30 minutes of inactivity.
https://simplestream.netlify.app/api/watch2gether?id=video_id
Name | Description | Required | Type |
---|---|---|---|
The video id. | Yes | String |
200
Content-Type: application/json
{
"status": "success",
"admin_link": "https://simplestream.netlify.app/stream-session-admin/JK2FK2cndx/hqPNK0zYDu",
"public_link": "https://simplestream.netlify.app/stream-session/JK2FK2cndx/hqPNK0zYDu"
}
Using the JavaScript IFrame Player API you can embed and control the video player using JavaScript.
This API lets you play, pause, retrieve information about the video being played and more.
This guide explains how you can use the JavaScript Player API on your own website.
The sample HTML page below creates an embedded player that will load a video, and show custom controls that let you control the video from the parent page.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="player" style="width:50vw;height:30vw;"></div>
<!-- Play the player by invoking the play function -->
<a href="javascript:play(player);">Play</a>
<!-- Pause the player by invoking the pause function -->
<a href="javascript:pause(player);">Pause</a>
<!-- Seek to 500 seconds by invoking the seek function -->
<a href="javascript:seek(player, 500);">Seek to 500s</a>
<!-- When the value of the input changes, change the current time of the player to the value of the input -->
<input type="range" min="0" value="0" onchange="seek(player, this.value);" id="input" onchange>
<!-- Import Player API -->
<script src="https://simplestream.netlify.app/content/js-player-api.js"></script>
<script>
// Define the player variable.
var player = document.getElementById("player");
// Load the player.
loadPlayer(player, "f0CEauw6d5");
// When the player loads
player.children[0].onload = function() {
// Every half a second...
setInterval(function() {
// Retrieve the duration, it will be set to the variable "playerDuration"
retrieveDuration(player);
// Set the max attribute of the input range to the player duration.
document.getElementById("input").setAttribute("max", playerDuration);
// Retrieve the currentTime, it will be set to the variable "playerDuration"
retrieveCurrentTime(player);
// Set the value of the input range to the player currentTime.
document.getElementById("input").value = playerCurrentTime;
}, 500);
};
</script>
</body>
</html>
The table below shows a complete list of functions with their description.
# | Function | Description |
---|---|---|
1 |
|
Loads the player. |
2 |
|
Changes the current time of the video to seconds. |
3 |
|
Plays the video. |
4 |
|
Pauses the video. |
5 |
|
Sets the value of variable "playerCurrentTime" to the current time of the video. |
6 |
|
Sets the value of variable "playerDuration" to the total duration of the video. |
If you need help, our want to suggest a feature we are all ears .
Email to us at contact[at]slidemovies[dot]ml