Widget:视频:修订间差异
来自HUIJIA FUN
Plurimod学生会(留言 | 贡献) 无编辑摘要 标签:已被回退 |
Plurimod学生会(留言 | 贡献) 无编辑摘要 标签:已被回退 |
||
| 第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- | .video-container { | ||
position: relative; | |||
padding-top: 56.25%; /* 16:9 aspect ratio */ | |||
width: 100%; | width: 100%; | ||
margin-bottom: 15px; | |||
} | } | ||
.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; | ||
border-radius: 6px; | |||
cursor: pointer; | cursor: pointer; | ||
z-index: 2; | z-index: 2; | ||
transition: background 0.3s; | |||
transition: | |||
} | } | ||
.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:视频.