@mgara/live_scale_api v1.1.16
live_scale_api
LiveScaleApi - JavaScript client for livescale_api
Welcome to the _LiveScale API Documentation. The LiveScale API allows you to connect your application to our live distribution platform and stream your events with just a few lines of code. # OpenAPI Specification This API is documented in OpenAPI format # Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with W3C spec. That allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. # Authentication LiveScale API offers OAuth2 as a form of authentication: OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications. # API Definitions This API relies on the following definitions. - Event
: An Event represents a parameterized instance where a presenter can manage and monitor his live presentation. - Presets
: The transcoding output profile, for better result, always make sure your preset's width and height are equal or lower than the resolution of your input feed while preserving the aspect ratio. - Destinations
: A social network destination or a custom rtmp destination. Social Media destinations can only be added to a User's account using the LiveScale web interface since it requires an external authentification. - Regions
: The geographic location of the live transcoding infrastructure. You should Specify the region closest to the source for lower latency. - Ingest
: The ingest resource created either automatic when the event is created, or created before hand and parametirized at the event creation. The url of the Ingest is where the live video feed is sent. - Player
: The Livescale embeddable player resource. Created automatically for every events or created before hand and parametirized at the event creation. - Dynamic Update
: The possibility to stop, start and add specific destinations to an ongoing Live event. # API Basic Flow The basic flow of the API goes as follow: 1. Authenticate your client to the API with the POST /token
operation. 2. Get the video transcoding presets with the GET /presets
method. 3. Get the available cloud infrastructures regions with the GET /regions
method. 4. Create a parameterized event with the POST /events
method. 5. Start the video engine with the POST /events/{event_id}/start
method. 6. Once the video engine is started, you can Start your Live Feed 7. Go Live with the POST /events/{event_id}/live
method. 8. Finally, Close the event with the DELETE /events/{event_id}
method. # API Optional Options - Get available user destinations (e.g. : social networks) with the GET /destinations
method. - Create static ingest points with the POST /ingests
method. - Create static dedicated players with the POST /players
method. - Dynamically update destinations during the live representation with the POST /events/{event_id}/destinations
methods. - Monitor the event with the GET /events/{event_id}
method. - Event reports which includes statistics are available with GET /events/{event_id}
or /events/done
method. *Note all calls are made under https://HOSTNAME/api/v1/
This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.1.13-oas3
- Package version: 1.1.13-oas3
- Build package: io.swagger.codegen.v3.generators.javascript.JavaScriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install live_scale_api --save
git
If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var LiveScaleApi = require('live_scale_api');
var api = new LiveScaleApi.AuthenticationApi()
var grantType = "grantType_example"; // {String}
var scope = "scope_example"; // {String}
var username = "username_example"; // {String}
var password = "password_example"; // {String}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getToken(grantType, scope, username, password, callback);
Documentation for API Endpoints
All URIs are relative to https://api.livescale.tv/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
LiveScaleApi.AuthenticationApi | getToken | POST /token | Get authentication token |
LiveScaleApi.DestinationApi | createGenericDestination | POST /destinations | Create a new Generic destination |
LiveScaleApi.DestinationApi | deleteADestination | DELETE /destinations/{destination_id} | Deletes a destination |
LiveScaleApi.DestinationApi | getUserDestinations | GET /destinations | Get user's destinations |
LiveScaleApi.DestinationApi | searchDestinations | POST /destinations/search | Search destinations |
LiveScaleApi.EventApi | appendDestination | POST /events/{event_id}/destinations | Append a destination to the event |
LiveScaleApi.EventApi | createEvent | POST /events | Create a new event |
LiveScaleApi.EventApi | deleteDestinationFromEvent | DELETE /events/{event_id}/destinations | Remove a destination from an event |
LiveScaleApi.EventApi | endEvent | DELETE /events/{event_id} | End/Cancel/Close an event |
LiveScaleApi.EventApi | endLiveForDestination | POST /events/{event_id}/destinations/stop | Stop the live presentation on a single destination. |
LiveScaleApi.EventApi | getClosedEvents | GET /events/done | Get the list of the user's closed events |
LiveScaleApi.EventApi | getEventById | GET /events/{event_id} | Get event information by its Id |
LiveScaleApi.EventApi | getOpenEvents | GET /events | Get the list of the user's open events |
LiveScaleApi.EventApi | goLive | POST /events/{event_id}/live | Go Live |
LiveScaleApi.EventApi | goLiveForDestination | POST /events/{event_id}/destinations/start | Go live on a single destination |
LiveScaleApi.EventApi | searchEvent | POST /events/search | Search Events |
LiveScaleApi.EventApi | startVideoEngine | POST /events/{event_id}/start | Starts an event's video engine instance |
LiveScaleApi.EventApi | stopVideoEngine | POST /events/{event_id}/stop | Stops an event's video engine instance |
LiveScaleApi.EventApi | updateEvent | PUT /events/{event_id} | Update the event |
LiveScaleApi.IngestApi | createIngest | POST /ingests | Create a new ingest point |
LiveScaleApi.IngestApi | deleteIngestById | DELETE /ingests/{ingest_id} | Delete ingest point |
LiveScaleApi.IngestApi | getAllIngests | GET /ingests | Get the list of the user's ingest points |
LiveScaleApi.IngestApi | getIngestById | GET /ingests/{ingest_id} | Get ingest information by its Id |
LiveScaleApi.IngestApi | searchIngest | POST /ingests/search | Search Ingests |
LiveScaleApi.PlayerApi | createPlayer | POST /players | Create web player |
LiveScaleApi.PlayerApi | deletePlayerById | DELETE /players/{player_id} | Delete web player |
LiveScaleApi.PlayerApi | getAllPlayers | GET /players | Get the list of the user's players |
LiveScaleApi.PlayerApi | getPlayerById | GET /players/{player_id} | Get player information by its Id |
LiveScaleApi.PlayerApi | searchPlayer | POST /players/search | Search Players |
LiveScaleApi.PresetApi | presetsGet | GET /presets | List all available transcoding presets |
LiveScaleApi.RegionApi | regionsGet | GET /regions | List all integrated cloud providers by regions |
LiveScaleApi.UserApi | style | POST /user/style | Create user's style |
LiveScaleApi.UserApi | userStyleGet | GET /user/style | Get user's default style |
Documentation for Models
- LiveScaleApi.Body
- LiveScaleApi.Body1
- LiveScaleApi.Body2
- LiveScaleApi.Body3
- LiveScaleApi.Destination
- LiveScaleApi.DestinationChannel
- LiveScaleApi.DestinationsResponse
- LiveScaleApi.Error
- LiveScaleApi.ErrorPayload
- LiveScaleApi.Event
- LiveScaleApi.EventDestination
- LiveScaleApi.EventDestinations
- LiveScaleApi.EventExtraData
- LiveScaleApi.EventMetadata
- LiveScaleApi.EventPreset
- LiveScaleApi.EventReport
- LiveScaleApi.EventSchedule
- LiveScaleApi.EventStatusHistory
- LiveScaleApi.EventVr
- LiveScaleApi.EventsResponse
- LiveScaleApi.EventseventIddestinationsstartDestinations
- LiveScaleApi.Ingest
- LiveScaleApi.IngestIngestUrl
- LiveScaleApi.IngestIngestUrlRtmp
- LiveScaleApi.IngestIngestUrlRtmps
- LiveScaleApi.IngestIngestUrlSrt
- LiveScaleApi.IngestsResponse
- LiveScaleApi.Node
- LiveScaleApi.NodeIngest
- LiveScaleApi.NodeIngestUrl
- LiveScaleApi.NodeIngestUrlRtmp
- LiveScaleApi.NodeIngestUrlRtmps
- LiveScaleApi.NodeIngestUrlSrt
- LiveScaleApi.NodeRegion
- LiveScaleApi.NodeStatusHistory
- LiveScaleApi.Player
- LiveScaleApi.PlayersPlayerMetadata
- LiveScaleApi.PlayersResponse
- LiveScaleApi.PlayersWidgets
- LiveScaleApi.Preset
- LiveScaleApi.PresetsResponse
- LiveScaleApi.Region
- LiveScaleApi.RegionsResponse
- LiveScaleApi.Style
- LiveScaleApi.StyleStyle
- LiveScaleApi.StylesResponse
- LiveScaleApi.Token
- LiveScaleApi.User
- LiveScaleApi.UserUserMetadata
- LiveScaleApi.UserUserMetadataRegion
Documentation for Authorization
application
- Type: OAuth
- Flow: password
- Authorization URL:
- Scopes:
- :
4 years ago