Auto-Load URL

Automatically Load a URL From the Video Without a Viewer Click

Patrick Farley avatar
Written by Patrick Farley
Updated over a week ago

Automatically loading a URL without a user-initiated action is generally discouraged UX - and technically prohibited by browsers in many cases.

HapYak annotations don't have the capability to load a URL without a user action. However, If you're technically inclined, you can do this yourself with our API. You would create a javascript listener for the video-complete event, then perform the desired action.

If you decide to take that approach HapYak can provide some code examples to help.

Here's a working example:
At the end of the video it auto navigates to

Here are the important lines of code:

onTrackingEvent: function(data) {
   if (data.event==="Player Action" &&"End")===0) {
      window.location.href = ""}}  

Note: this even works on an iPhone (even when the video is playing in the native QuickTime app).

Please Note: this is a Proof of Concept only provided to show the possibilities of the HapYak Platform and should not be taken as an offer to create, edit or maintain custom integration or development.

Did this answer your question?