Embedding Events
Events concerning particular embeddings such as recorder and player.
Benefits
These events are specific to individual recorders or players.
- Ziggeo's SDK raises events in real time
- Simply prepare code to run at requested times
- No need to monitor or institute checks for particular occurrences
Preface
- Parameters of events depending on the particular event
- If you need to obtain additional data from the embedding, you can use the
embedding.get
function, i.e.:embedding.get('video')
within as well as outside of events.
Access recorder embedding
var element = document.getElementById('elementID');
var embedding = ZiggeoApi.V2.Recorder.findByElement(element);
Access player embedding
var element = document.getElementById('elementID');
var embedding = ZiggeoApi.V2.Player.findByElement(element);
List of events
Here is the full list of events.
- Media events 10/10
The list of all events that are connected to your media
Media can be recorded, played and re-recorded. This section will help you get the details about your media as it happens, telling you exactly what happens and where.
-
ended
Fires when a video has ended
- healthy true if healthy
embedding.on("ended", function (healthy) { //Your code goes here });
-
invoke-skip
Someone skipped choosing the poster image
embedding.on("invoke-skip", function () { //Your code goes here });
-
loaded
Triggered when the media is loaded
embedding.on("loaded", function () { //Your code goes here });
-
paused
Fires when the pause button is clicked
embedding.on("paused", function () { //Your code goes here });
-
playing
Fires after each play action is triggered (even if paused and then played, or if a seek operation is done)
embedding.on("playing", function () { //Your code goes here });
-
recording
Triggered when a recording process has started
embedding.on("recording", function () { //Your code goes here });
-
rerecord
Triggered when a recorded video is discarded and is being re-recorded
embedding.on("rerecord", function () { //Your code goes here });
-
seek
Triggered when the user moves the progress indicator to continue video playback from a different position
- position position in video
embedding.on("seek", function (position) { //Your code goes here });
-
select-image
Fires once the cover image has been selected
- image the image object representing the selected image
embedding.on("select-image", function (image) { //Your code goes here });
-
uploading
Triggered when a video is uploading
embedding.on("uploading", function () { //Your code goes here });
- DOM related events 1/1
The list of events that are connected to DOM in some way
These events would usually fire as some change happens in the HTML (DOM tree). The DOM event can be specific to our embedding, or more global in its nature.
-
attached
Fires when the embedding is attached to the DOM element
embedding.on("attached", function () { //Your code goes here });
- Progress events 6/6
The list of events that inform you of different progress states
If you want to create something special, provide additional ways of keeping your visitors informed or attentive as things happen, you often need to know different states of progress. One good example is if you plan to build your own flashy upload progress bar.
That and all other events are shown here.
-
countdown
Triggered while a video recorder counts down
- time Timer time
embedding.on("countdown", function (time) { //Your code goes here });
-
processed
Processing completed
embedding.on("processed", function () { //Your code goes here });
-
processing
Processing Progress
- percentage Percentage processed
embedding.on("processing", function (percentage) { //Your code goes here });
-
recording_progress
Recording Progress
- time Elapsed time while recording
- paused Only with WebRTC recorder, accept true value if recorder was paused, default is false
embedding.on("recording_progress", function (time, paused) { //Your code goes here });
-
upload_progress
Upload Progress
- uploaded Bytes uploaded
- total Bytes total
embedding.on("upload_progress", function (uploaded, total) { //Your code goes here });
-
uploaded
Triggered when a video has been uploaded / recorded (but not processed)
embedding.on("uploaded", function () { //Your code goes here });
- Errors related events 7/7
The list of events that inform you when some forms of errors happen
Errors are common thing for any web and non web based systems. Some errors are actually notifications that we need to do something like plugging in our camera. Others can be more serious. These events help you know when these happen and react as you wish.
-
access_forbidden
Triggered when access to camera or microphone is not granted
- error Error data
embedding.on("access_forbidden", function (error) { //Your code goes here });
-
access_granted
Triggered when access to camera and microphone is granted
embedding.on("access_granted", function () { //Your code goes here });
-
camera_nosignal
Triggered when camera has no signal.
- data The object data
embedding.on("camera_nosignal", function (data) { //Your code goes here });
-
camera_unresponsive
Triggered when camera has become unresponsive.
- error Error data
embedding.on("camera_unresponsive", function (error) { //Your code goes here });
-
error
Triggered when an embedding encounters an error
- error_type type of the error
- error_code code giving more details about the error
embedding.on("error", function (error_type, error_code) { //Your code goes here });
-
no_camera
Triggered when no camera has been detected.
embedding.on("no_camera", function () { //Your code goes here });
-
no_microphone
Triggered when no microphone has been detected.
embedding.on("no_microphone", function () { //Your code goes here });
- Informational events 19/19
The list of events that inform you of different things that happen on your form
All events are informational in their nature. While the events are not specific as the ones above, they still offer you insight into different things that happen on your pages and around your embeddings.
-
bound
Happens when hardware has been bound and is about to be ready to use
embedding.on("bound", function () { //Your code goes here });
-
camera_signal
Triggered when camera has signal.
embedding.on("camera_signal", function () { //Your code goes here });
-
camerahealth
Triggered when camera health changes.
- healthy true if healthy
embedding.on("camerahealth", function (healthy) { //Your code goes here });
-
change-google-cast-volume
Fires when volume is changed on playback on Google Cast
embedding.on("change-google-cast-volume", function () { //Your code goes here });
-
has_camera
Triggered when a camera has been detected.
embedding.on("has_camera", function () { //Your code goes here });
-
has_microphone
Triggered when a microphone has been detected.
embedding.on("has_microphone", function () { //Your code goes here });
-
mainvideostreamended
Fires once multistream capture is stopped.
embedding.on("mainvideostreamended", function () { //Your code goes here });
-
manually_submitted
Triggered when a video has been manually submitted
embedding.on("manually_submitted", function () { //Your code goes here });
-
microphonehealth
Triggered when microphone health changes.
- healthy true if healthy
embedding.on("microphonehealth", function (healthy) { //Your code goes here });
-
pause-google-cast
Fires when Google Cast is used to play the video and the video is paused
embedding.on("pause-google-cast", function () { //Your code goes here });
-
play-google-cast
Fires when Google Cast is used to play the video
embedding.on("play-google-cast", function () { //Your code goes here });
-
ready_to_play
Triggered when a video player is ready to play a video
embedding.on("ready_to_play", function () { //Your code goes here });
-
ready_to_record
Triggered when a video recorder is ready to record a video
embedding.on("ready_to_record", function () { //Your code goes here });
-
ready-to-trim
Triggered when a video is waiting to be trimmed.
embedding.on("ready-to-trim", function () { //Your code goes here });
-
recording_stopped
Recording Stopped
embedding.on("recording_stopped", function () { //Your code goes here });
-
stopped
Fires when playback is manually stopped
embedding.on("stopped", function () { //Your code goes here });
-
upload_selected
Triggered when a file has been selected for upload
- file File object
embedding.on("upload_selected", function (file) { //Your code goes here });
-
verified
Triggered after video is uploaded and verified that it can be processed.
embedding.on("verified", function () { //Your code goes here });
-
video-trimmed
Triggered after a video is trimmed manually or using the trimming overlay.
- start Time in seconds where trimmed video should start
- end Time in seconds where trimmed video should end
- originalDuration Duration of the video before trimming
embedding.on("video-trimmed", function (start, end, originalDuration) { //Your code goes here });