简体   繁体   English

Google Chrome-播放本地存储中的文件不起作用

[英]Google chrome - playing a file from local storage is not working

I need to play video file in local Kiosk. 我需要在本地信息亭中播放视频文件。 Which has Windows 8.1 64-bit, with Google canary/chrome latest version. 其中具有Windows 8.1 64位,并具有Google canary / chrome最新版本。 I have same problem with latest Google Chrome/canary versions its not playing files from local storage. 我在使用最新的Google Chrome / canary版本时遇到了同样的问题,即无法播放本地存储中的文件。 If i play from cloud i have bandwidth issue+ there is no internet access for the kiosk. 如果我从云播放,则带宽问题+信息亭没有互联网访问。

Step 1 : allow everything zero restrictions 第1步:允许一切为零

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --incognito --allow-file-access-from-files --disable-web-security 

Step 2: 第2步:

Now i open a remote url https://stackoverflow.com/test.html , which is trying to play a video file which is located in the users PC, C:\\loop.webm 现在,我打开一个远程URL https://stackoverflow.com/test.html ,它试图播放位于用户PC C:\\ loop.webm中的视频文件。

example: test.html 示例:test.html

<video id="mediaplayer" autoplay="autoplay" poster="/images/vlc.jpg" type="video/webm" loop="" src="file:///C:/loop.webm" style="display: inline;"></video>

Result: 结果:

The page at 'https://....mysite.com/test.html' was loaded over HTTPS, but displayed insecure content from 'file:///C:/loop.mp4': this content should also be loaded over HTTPS.

Gives no error, but does not read a file, play the file at all. 没有错误,但不读取文件,根本不播放文件。

How can i play the file in this case? 在这种情况下如何播放文件?

The error is telling you what's wrong! 错误告诉您出了什么问题! The C:\\ drive doesn't have a HTTPS certificate - it can't - but the website you are using has one. C:\\驱动器没有HTTPS证书-它没有-但您正在使用的网站有一个。 Chrome is doing this to protect a user's security. Chrome这样做是为了保护用户的安全。 If you want to load a video file from the C:\\ drive, you need to do it on a non-https website. 如果要从C:\\驱动器加载视频文件,则需要在非https网站上进行处理。

EDIT: This plugin appears to be a work-around: https://chrome.google.com/extensions/detail/jllpkdkcdjndhggodimiphkghogcpida 编辑:此插件似乎是一种解决方法: https : //chrome.google.com/extensions/detail/jllpkdkcdjndhggodimiphkghogcpida

Google Chrome/Canary do not support it even via command line if its applied. Google Chrome / Canary即使通过命令行也不支持它(如果已应用)。 Temporary using Nginx to execute the files locally. 使用Nginx临时在本地执行文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM