SDK functions
Last updated
Last updated
Create an instance of a Singular overlay with the following code:
You can also use adaptive parameters to define a specific adaptive layout define in the composition.
Loads a Singular graphic into the overlay instance.
Options to define the content:
Sample
Content options
Locate the Revision URL in Singular Composer
Adds a listener for events coming from the overlay.
Values for listener type
Sample: Listen to message
from interactive events
Sample: Listen to error
reported by the Overlay Instance
Defines the delay for the execution of incoming graphics control commands.
Sample
Shows the graphics overlay by setting the iFrame visibility to visible
.
Hides the graphics overlay by setting the iFrame visibility to hidden
.
Deletes the graphics overlay.
Notifies the overlay SDK that the video is playing.
Notifies the overlay SDK that the video is paused.
Notifies the overlay SDK that the video is buffering.
Notifies the overlay SDK that the video is stopped.
Notifies the overlay SDK that the video is finished.
Notifies the overlay SDK that the video is seeking at a specific time. Time is in seconds.
Sample
Notifies the overlay SDK that the seeking operation is finished.
Sends the current time of the video to the overlay SDK.
Sample
Sends information about the video. This info can be received in the interactive layer code.
The user clicked the mute button in the video player.
The user clicked the mute button in the video player again.
The user changed the volume of the video.
Sample
The video player is playing an advertisement. The interactive layer can then hide certain graphics.
UTC time received from the video that the overlay SDK can use to synchronize graphics to video. The format of time is Unix timestamp.
Sample
Send a message to the interactive layer.
Sample
class
class
iFrameClass
Can be used to style the iframe that the overlay SDK creates.
endpoint
String
app.singular.live
Optional. Can be used to work with different Singular servers.
delay
String
0
Specified in milliseconds. It tells the overlay SDK to execute commands coming through Firebase later.
interactive
Boolean
true
Tells the overlay if it should handle mouse events. This will simply set pointer-events: none
on the iframe that is created.
syncGraphics
Boolean
false
Tells the render engine to synchronize graphics to UTC time received by videoSegment
calls.
showPreloader
Boolean
false
Shows or hides the animation indicating that graphics are loading.
aspect
String
empty
Defines the aspect ratio of the graphics window. When unspecified, the graphics will cover 100% of the iframe.
screenSize
Class
iFrameClass
Select
layout
String
app.singular.live
textDirection
String
0
0 ... left-to-right 1 ... right-to-left
interactive
Boolean
false
true ... propagate interactions to overlay false ... ignore interactions
language
String
Empty
Language code (en, fr, es, de
, ...)
custom1
String
Empty
Custom Parameter
custom2
String
Empty
Custom Parameter
custom3
String
Empty
Custom Parameter
content
String or JSON
Yes
Content can be a string or an object and contain one of the values described below.
callback
Function
Yes
The callback function is called when content has been loaded.
string
String
-
The composition revision URL.
compToken
String
-
The compositions token.
appOutputToken
String
-
The app output token.
webOutputToken
String
-
The web output token.
type
String
Yes
An object containing one of the values described below.
callback
Function
Yes
The callback function for the type
of event.
message
Listens to messages from interactive events and sends messages back to the video player.
error
Listen to errors reported by the overlay instance.
delay
Number
Yes
Delay in milliseconds.
time
Number
Yes
Time in seconds.
time
Number
Yes
Time in seconds.
object
object
Yes
add description
value
Number
Yes
The volume of the video.
value
Number
Yes
The volume of the video.
time
Time in the format of the UNIX timestamp
String
Yes
object
object
Yes
Custom data as JSON object
domId
String
Yes
The target div
that the SingularOverlay will replace.
options
JSON
Yes
Configuration options to define how to render an overlay. See the config option description below.
callback
Function
Yes
Callback function called when the overlay object has been created.