ionic dailymotion iframe 播放器 "ERR_FILE_NOT_FOUND"

ionic dailymotion iframe player "ERR_FILE_NOT_FOUND"

当我使用浏览器预览应用程序时,视频播放器可以正常工作,但在 phone 上出现以下错误我认为问题在于添加的 'file:' 是导致问题的原因但我似乎无法用 string.replace('file:','') 摆脱它:

The webpage at file://wwwdailymotion.com/embed/video/{video_id} could not be loaded becuase:

net::ERR_FILE_NOT_FOUND

player.ts:

this.video_link = "//www.dailymotion.com/embed/video/"+this.video_id;

player.html:

<iframe [src]="sanitizer.bypassSecurityTrustResourceUrl(video_link)" allowfullscreen frameborder="0" width="100%" height="200px" ></iframe>

这是因为 Cordova 的工作方式。它从设备上的文件系统加载您的站点,因此通过不提供协议,它假定 file://

将您的 link 更改为使用 https,我怀疑它会起作用:

this.video_link = "https://www.dailymotion.com/embed/video/"+this.video_id;