Widget:视频:修订间差异

来自HUIJIA FUN
无编辑摘要
标签已被回退
无编辑摘要
标签已被回退
第25行: 第25行:
<script src="//api.html5media.info/1.2.2/html5media.min.js"></script>
<script src="//api.html5media.info/1.2.2/html5media.min.js"></script>
<style>
<style>
.video-player {
.video-container {
   display: none;
   position: relative;
  padding-top: 56.25%; /* 16:9 aspect ratio */
   width: 100%;
   width: 100%;
   height: 100%;
   margin-bottom: 15px;
  object-fit: cover;
}
}
.video-load-btn {
 
  /* 保持基础样式 */
.video-player, .video-load-btn {
   position: absolute;
   position: absolute;
   top: 0;
   top: 0;
第38行: 第38行:
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
}
.video-load-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
   background: #4285f4;
   background: #4285f4;
   color: white;
   color: white;
   border: none;
   border: none;
   font-size: 18px;
   border-radius: 6px;
   cursor: pointer;
   cursor: pointer;
  border-radius: 6px;
   z-index: 2;
   z-index: 2;
  /* 移除任何可能的动画或渐变 */
   transition: background 0.3s;
   transition: none;
}
}
.video-load-btn:hover {
.video-load-btn:hover {
第52行: 第57行:
}
}


.video-player {
  display: none;
  object-fit: cover;
}
</style>
<div class="video-container"
    data-url="<!--{$url|validate:url|escape:'html'}-->"
    data-width="<!--{$width|default:640|validate:int|escape:'html'}-->"
    data-height="<!--{$height|default:360|validate:int|escape:'html'}-->">
  <button class="video-load-btn" onclick="loadWidgetVideo(this)">▶ Load Video</button>
  <video class="video-player" controls preload="none"></video>
</div>
</div>


第64行: 第81行:
   if (url) {
   if (url) {
     video.src = url;
     video.src = url;
     video.style.display = 'block'; // 无动画直接显示
     video.style.display = 'block';
     video.width = width;
     video.width = width;
     video.height = height;
     video.height = height;

2025年7月5日 (六) 03:45的版本

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

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

It was created by taipan.

Using this widget

See widget description page on MediaWikiWidgets.org.

Copy to your site

Install MediaWiki Widgets extension and copy the full source to Widget:视频.