How to embed video in Angular2?

I want to develop a single page application. It is a video portal where users can log in, view video lists, navigate to a single video, rate a video, and complete all media-related tasks such as Play, Pause, Adjust Volume, and Search for Videos.

Since there is a tag <video>

in HTML5

, is it possible to use tags HTML5

internally app.component.html

to insert a video?

Or could it be a library that I have to install from angular2

and then call it inside the file app.component.ts

?
Or maybe there is another way!

+3


source to share


1 answer


Don't need to include Angular unless you find a need. Within your Angular template, you can use any HTML tags as long as they are supported by the browsers you want to support.

Just add an HTML5 tag <video>

to your template app.component.html

and include the src attribute in your video file location -

<video width="320" height="240" controls>
    <source src="movie.mp4" type="video/mp4">
    Your browser does not support the video tag.
</video>

      




An example was copied from the W3Schools HTML Tags Page

+4


source







All Articles