Search code examples
azureazure-media-services

azure media player click event


I have to track event when turn on the video(click on big button). I show result about "tech-click" but it's not click on the big button.

  player = amp(randomId, <any>{
                techOrder: ["azureHtml5JS", "flashSS", "html5FairPlayHLS", "silverlightSS", "html5"],
                "nativeControlsForTouch": false,
                "logo": { "enabled": false },
                controls: true,
                width: attrs.width,
                height: attrs.height,
                autoplay: scope.autoplay,
                poster
            });


  player.addEventListener("tech-click", () => {
        appInsights.trackEvent("homeVideo");                  
  });

Solution

  • document.getElementsByClassName("vjs-big-play-button[0]
    .addEventListener("click", () => {
                                appInsights.trackEvent("homeVideo");
                            });