skB*_*ore 6 html javascript html5-video plyr.js
我正在使用Plyr JS  并希望download为每个提供选项video.
以下是我试图download option提供的内容:
尽管我提供了:  controlsList="nodownload"
<video controls crossorigin playsinline controlsList="nodownload" poster="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg" id="player">
     <source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4" type="video/mp4" size="576">
</video>
问题:如何使下载选项Plyr.io仅使用插件显示?
这是我的演示: https ://codepen.io/msolimans/pen/xQEjmX
您可以使用 Plyr JS 自定义所有 Plyr 控件。这是来自官方来源的完整描述。
控件
这是为 Plyr 控件呈现的标记。您可以使用默认控件或根据需要提供自定义版本的标记。您可以将以下内容传递给控件选项:
Array选项(这会根据您的选择构建默认控件)
Element与控件
String包含所需的 HTML
false(或空字符串或数组)以禁用所有控件
Function将被执行并应返回上述之一
演示:CodePen.io 上带有自定义控件的 Plyr 播放器(包括下载按钮)
在 StackOverflow 片段中,下载按钮不起作用,因为它在沙箱中。请参阅 CodePen.io 上的演示(上面的链接)。
Array选项示例:
var controls =
[
    'play-large', // The large play button in the center
    'restart', // Restart playback
    'rewind', // Rewind by the seek time (default 10 seconds)
    'play', // Play/pause playback
    'fast-forward', // Fast forward by the seek time (default 10 seconds)
    'progress', // The progress bar and scrubber for playback and buffering
    'current-time', // The current time of playback
    'duration', // The full duration of the media
    'mute', // Toggle mute
    'volume', // Volume control
    'captions', // Toggle captions
    'settings', // Settings menu
    'pip', // Picture-in-picture (currently Safari only)
    'airplay', // Airplay (currently Safari only)
    'download', // Show a download button with a link to either the current source or a custom URL you specify in your options
    'fullscreen' // Toggle fullscreen
];
var player = new Plyr('#player', { controls });
添加带有“下载”标签的链接
<a href="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4" download> download </a>