Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html can’t load local video on iOS #678

Open
Lyfei opened this issue Apr 14, 2023 · 0 comments
Open

Html can’t load local video on iOS #678

Lyfei opened this issue Apr 14, 2023 · 0 comments

Comments

@Lyfei
Copy link

Lyfei commented Apr 14, 2023

ionic3, webview plugin 4.2.1

Html

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

use fileTransfer plugin download video, get a url like:

file:///var/.../Documents/video.mp4
// also tried toInternalURL()

error: Not allowed to load local resource

try

this.videoUrl = this.win.Ionic.WebView.convertFileSrc(url); // ionic://localhost/_app_file_/var/.../Documents/video.mp4
// or use sanitizer
this.videoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.win.Ionic.WebView.convertFileSrc(url));

both error: Failed to load resource: unsupported URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant