0

I have some videos located in an S3 bucket and Im referencing their links in a DynamoDB table along with some other relevant info (all as items). I have created a simple AngularJS app that retrieves the items from the Dynamo table via API Gateway and Lamdba and simply displays the info in a controller. Here is the body of my index.html:

<body> <div class="row" ng-controller="content"> <div class="col-8"> <p><b>{{content['course-title']}}</b></p> <p>{{content['course-video']}}</p> <p>The ID is {{content['course-content']}}</p> </div> </div> </body> 

and here is my .js for the single controller:

.controller('content', function($scope, $http) { $http.get('api link'). then(function(response) { $scope.content = response.data.body[0]; console.log(response) }); }); 

As you can see I am returning a json array in the response and referencing each element by name in the controller itself.

Everything is working fine with the process except for the video.

Here is my question:

One of the table items is a link to a video in S3 as follows:

https://xyz-videos.s3.amazonaws.com/video.mp4

How/what do I need to do to embed the video properly so it will display? It is referenced by:

<p>{{content['course-video']}}</p> 

Obviously, right now just the link is being returned. How do I incorporate it properly as a video source?


I tried using <video> element and I got the following error:

$interpolate:interr Interpolation Error.

I had to use ng-src, but still got the error

4
  • Did you try using a <video> element? Commented Feb 22, 2020 at 19:33
  • Yes, I have and I got the following error: $interpolate:interr Interpolation Error. I had to use ng-src, but still got the error. Commented Feb 22, 2020 at 21:25
  • The interpolation failed because of some exception. It would be helpful to edit the question to include all of the error message. Commented Feb 22, 2020 at 23:38
  • @georgeawg yes, thanks for doing that for me and Ill remember that next time - been a little while since Ive been super active here. Commented Feb 22, 2020 at 23:40

1 Answer 1

0

Use the video tag:

<p><video width="320" height="240" autoplay> <source src={{content['course-video']}} type="video/mp4"> Your browser does not support the video tag. </video></p> 
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks - I had already tried such and got the following error when I did: $interpolate:interr Interpolation Error
you also need to follow this steps stackoverflow.com/a/22577208/290036
How does that solution work with dynamic content? I need the src to be dynamic. Thank you for you help.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.