5

I am using IONIC and retrieving the URL from the server, I can see the URL when using <p> tags as follows:

<p>{{URL}}</p>

but when I try the following:

<video width="320" height="240" controls>
  <source src="{{URL}}" type="video/mp4">
</video>

I get an error (Get request error) that says "Unsafe url"

I find people suggesting to use sanitizer.bypassSecurityTrustResourceUrl like in this page but unfortunately, it didn't work for me

NOTE: the video is located inside the project folders, and the URL is retrieved from the database.

How can I enable the <video> tag to play videos from the project directory?

1 Answers1

4

It can be permission issue, try to change the project directory to a different drive, for example, if it is located in "C" drive, move it elsewhere.

Behrouz Riahi
  • 1,751
  • 2
  • 21
  • 42