Widget:视频:修订间差异

来自HUIJIA FUN
(修改页面)
无编辑摘要
第2行: 第2行:
<pre>
<pre>
{{#widget:视频
{{#widget:视频
|url=https://vip.123pan.cn/1826204916/Dipfield/%E5%96%86%E6%BC%94%E8%AE%B2.mp4
|url=https://vip.123pan.cn/1826204916/5651071
|width=640
|width=640
|height=auto
|height=auto
第8行: 第8行:
</pre>
</pre>
{{#widget:视频
{{#widget:视频
|url=https://vip.123pan.cn/1826204916/Dipfield/%E5%96%86%E6%BC%94%E8%AE%B2.mp4
|url=https://vip.123pan.cn/1826204916/5651071
|width=640
|width=640
|height=auto
|height=auto
第24行: 第24行:
</noinclude>
</noinclude>
<includeonly>
<includeonly>
<script src="//api.html5media.info/1.2.2/html5media.min.js"></script><video src="<!--{$url|validate:url|escape:html|regex_replace:"#^(?!(https?:)?//).*#i":''}-->" width="<!--{$width|default:425|validate:int|escape:'html'}-->" height="<!--{$height|default:355|validate:int|escape:'html'}-->" controls preload></video>
<script src="//api.html5media.info/1.2.2/html5media.min.js"></script>
<div class="video-container">
  <video id="videoPlayer-<!--{$unique_id|escape:'html'}-->"  
        width="<!--{$width|default:425|validate:int|escape:'html'}-->"  
        height="<!--{$height|default:355|validate:int|escape:'html'}-->"  
        controls>
    Your browser does not support HTML5 video.
  </video>
  <button class="load-video-btn"
          onclick="loadVideo('videoPlayer-<!--{$unique_id|escape:'html'}-->', '<!--{$url|validate:url|escape:html|regex_replace:"#^(?!(https?:)?//).*#i":''}-->')">
    Load Video
  </button>
</div>
<style>
  .load-video-btn {
    display: block;
    margin-top: 8px;
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  .load-video-btn:hover {
    background: #45a049;
  }
</style>
<script>
  function loadVideo(playerId, url) {
    var player = document.getElementById(playerId);
    var btn = player.nextElementSibling;
   
    player.setAttribute('src', url);
    player.setAttribute('preload', 'auto');
    btn.style.display = 'none';
    player.style.display = 'block';
  }
</script>
</includeonly>
</includeonly>

2025年4月5日 (六) 21:08的版本

{{#widget:视频
|url=https://vip.123pan.cn/1826204916/5651071
|width=640
|height=auto
}}

This widget lets you embed HTML5 Video Media on your wiki page.

It was created by taipan.

Using this widget

For information on how to use this widget, see widget description page on MediaWikiWidgets.org.

Copy to your site

To use this widget on your site, install MediaWiki Widgets extension and copy the complete source code of this page to your wiki as page Widget:视频.