Extending Functionality in Vuforia Studio with Code > Using JavaScript in Vuforia Studio > Link to Remote Media
Link to Remote Media
You can link to remote media resources at runtime using JavaScript. This can be done for the Audio and Video widgets. You may want to do this for some video and audio content stored on other servers that may be difficult to keep within a project.
You can link to a remote media resource at design time by providing the Resource value in the DETAILS pane. Using bindings for remote resources is not supported at this time.
Below is an example of how you might use JavaScript and bindings to set the remote media for a video:
1. Drag and drop a Video widget onto the canvas.
2. Enter the following JavaScript in the Home.js editor:
$scope.assignTrustedUrl = function() {
$scope.view.wdg['video-1'].videosrc = 'http://example.org/example.mp4';
3. Drag and drop a Button widget onto the canvas, and name the button Load Video.
4. Click JS next to the Click event on in the DETAILS pane, and enter the following in the expression box:
5. Now, when you view the experience and click the “Load Video” button, the video referenced in the JavaScript is loaded in the Video widget, and you can then view the video.