dimanche 29 mars 2015

html video player not always read from src

I want to play a video file from my web server. Here is my HTML code.



<video width="100%" height="100%" controls>
<source ng-src="{{media_url}}" type="video/mp4" />
</video>
<div>{{media_url}}</div>


In angular controller:



$scope.media_url = '/get_video/movie.mp4';


Every time I refresh the page, the div is displaying correctly. However, the video player is not always sending request to "/get_video/movie.mp4". Its behavior looks random.


If I set the src directly, then there's no problem:



<source ng-src="/get_video/movie.mp4" type="video/mp4" />


Any idea why?


Aucun commentaire:

Enregistrer un commentaire