I have implemented videoviewer in my site, and I want to listen to events such as pause, play ended etc. The documentation doesn't really explain how this is done.
My code to implement video is as follows:
var videoViewer = new s7viewers.VideoViewer({
"containerId":"s7viewer",
"params":{
"asset":"Scene7SharedAssets/Glacier_Climber_MP4",
"serverurl":"http://s7d1.scene7.com/is/image/",
"videoserverurl":"http://s7d1.scene7.com/is/content/"
},
"handlers":{
"initComplete":function() {
console.log("init complete");
var test = s7viewer.playback;
console.log(test);
},
"trackEvent":function(objID, compClass, instName, timeStamp, eventInfo) {
//identify event type
var eventType = eventInfo.split(",")[0];
console.log(instName)
switch (eventType) {
case "LOAD":
//custom event processing code
console.log("loaded")
break;
//additional cases for other events
}
}
}
})
videoViewer.setHandlers({
"initComplete":function() {
console.log("init complete 2");
},
"trackEvent":function(objID, compClass, instName, timeStamp, eventInfo) {
console.log(objID);
console.log(compClass);
console.log(instName);
console.log(eventInfo);
console.log(timeStamp);
},
})
videoViewer.init();
When you pause the video eventInfo has no value, how can I detect when video has been paused. here is the documentation:
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
I think you would have to change the parameters all over the code to your own video (some are bolded below). The code given in the documentation is only an example.
"params":{ "asset":"Scene7SharedAssets/Glacier_Climber_MP4", "serverurl":"http://s7d1.scene7.com/is/image/", "videoserverurl":"http://s7d1.scene7.com/is/content/"
let me know if this helps.
Regards,
TM
Views
Replies
Total Likes
Hi,
I think you would have to change the parameters all over the code to your own video (some are bolded below). The code given in the documentation is only an example.
"params":{ "asset":"Scene7SharedAssets/Glacier_Climber_MP4", "serverurl":"http://s7d1.scene7.com/is/image/", "videoserverurl":"http://s7d1.scene7.com/is/content/"
let me know if this helps.
Regards,
TM
Views
Replies
Total Likes
Views
Likes
Replies