更改NGINX提供的静态文件的HTML5视频播放器大小



我想通过https访问家用服务器的某些文件。

我设置了带有以下配置的NGINX服务器:

location /files/ {
    autoindex on;
    auth_basic "Restricted Content";
    auth_basic_user_file /etc/nginx/.htpasswd;
}

一切似乎都可以正常工作。

我唯一的烦恼是,当我访问音乐或视频文件时,出现的HTML5播放器通常很小。通过添加element.style属性:

width: 600px;

我想知道是否有一种方法可以在服务媒体文件时自动设置此属性。也许我可以编辑某种默认的CSS文件?

如 @alexey-ten评论,这是浏览器的属性,而不是nginx的属性。

我最终使用以下temponkey脚本更改默认脚本:

(function() {
    'use strict';
    console.log('hello');
    var elem = document.getElementsByTagName('video');
    console.log(elem);
    elem[0].style.width = "100%";
})();

最新更新