Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I get unsafe URL when trying to view video using its path

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?

like image 488
Source Plaze Avatar asked Feb 27 '19 16:02

Source Plaze


1 Answers

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.

like image 179
Behrouz Riahi Avatar answered Oct 13 '22 02:10

Behrouz Riahi