Track events such as pause or ended with VideoViewer | Community
Skip to main content
October 16, 2015
Solved

Track events such as pause or ended with VideoViewer

  • October 16, 2015
  • 1 reply
  • 763 views

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:

https://marketing.adobe.com/resources/help/en_US/s7/viewers_ref/r_html5_video_viewer_20_sitecatalystracking.html

 

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by TanmayMathur

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

1 reply

TanmayMathur
Adobe Employee
TanmayMathurAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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