API Docs

Contents
  1. Files
    1. Get a List of Files
    2. Get File Information
  2. Watch2Gether
    1. Create a Room
  3. JavaScript Player API
    1. Getting Started
    2. Functions




Files

Using the SimpleStream API you can get a list of all of your files, and get information of each individual file.




File List

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

Response

200


Headers

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": ""
}]
      



File Information

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

Response

200


Headers

Content-Type: application/json


{
	"name": "4K.mp4",
	"id": "B35Ph8IhAB",
	"account_key": "123"
}
      



Files

Using the SimpleStream API you can get a list of all of your files, and get information of each individual file.




File List

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

Response

200


Headers

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": ""
}]
      



Watch2Gether

Using the SimpleStream API you can create Watch2Gether rooms so two or more people can watch a video at the same time.




Create a Room

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

Response

200


Headers

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"
}
      






JavaScript Player API

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.




Getting Started

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>
      



Functions

The table below shows a complete list of functions with their description.

# Function Description
1
loadPlayer(player, id)
Loads the player.
2
seek(player, seconds)
Changes the current time of the video to seconds.
3
play(player)
Plays the video.
4
pause(player)
Pauses the video.
5
retrieveCurrentTime(player)
Sets the value of variable "playerCurrentTime" to the current time of the video.
6
retrieveDuration(player)
Sets the value of variable "playerDuration" to the total duration of the video.

Having trouble with our service, need help, or want to suggest a feature?

If you need help, our want to suggest a feature we are all ears .

Email to us at contact[at]slidemovies[dot]ml




SimpleStream

Terms and Conditions    Copyright & DMCA Request Policy    FAQ    API
  Information
Copied to clipboard.