I found a solution that worked really well for me:
This is the HTML code:
<div ng-app="myApp" ng-controller="MyCtrl" class="wrapper">
<div ng-bind-html="fullVideo() | to_trusted"></div>
</div>
In the videoController.js file:
var myApp = angular.module('myApp',[]);
angular.module('myApp')
.filter('to_trusted', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
function MyCtrl($scope) {
$scope.name = 'Superhero';
$scope.videoid = 1;
$scope.fullVideo = function() {
return '<video id="myVideo" width="100%" controls height="auto" preload="auto" poster="img/poster_nologo.jpg"><source id="mp4src" src="videos/video'+$scope.videoid+'.mp4" type="video/mp4"></video>'
};
}