Reputation: 43
I am playing video in mat-video and video tag, but none of them playing video which has video codec type as mpeg 4 (simple profile) however H.264 codec format is playing fine. is there any way to support mpeg 4 codec in video tag I tried :
<html>
<video>
<source src="videoUrl" type='video/mp4; codecs="amp4v.20.8,mp4a.40.2"'/>
</video>
</html>
<mat-video title="{{videoTitle}}" [autoplay]="true" [preload]="true" [fullscreen]="true" [download]="false">
<source matVideoSource [src]="videoFileName" type='video/mp4;codecs="amp4v.20.8,mp4a.40.2"'>
</mat-video>
Tried adding multiple codecs but none of them worked.
Upvotes: 2
Views: 2077
Reputation: 26
We can not play video with 'mpeg-4 video' codec . For that you will have to convert video codec to 'h.264' from any converter. I had also faced similar issue and I managed to convert this video through AWS media convert service. With AWS media convert SDK , I converted around 500 video by submitting batchJobs via nodejs script using their SDK.
Examples can be found here:
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/emc-examples-templates.html
Upvotes: 0