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-container {
  .video-container {
        position: relative;
    position: relative;
        /* Remove fixed width/height if you want it to adapt to content, or set explicitly */
    width: <!--{$width|default:425|validate:int|escape:'html'}-->px;
        width: px; /* Use the width from the widget for consistency */
    height: <!--{$height|default:355|validate:int|escape:'html'}-->px;
        height: auto; /* Let height adjust based on content */
    margin-bottom: 15px;
        margin-bottom: 15px;
  }
        display: flex; /* Use flexbox */
  .video-load-btn {
        justify-content: center; /* Center horizontally */
    position: absolute;
        align-items: center; /* Center vertically */
    top: 50%;
        min-height: 100px; /* Give it a minimum height so the button is visible before load */
    left: 50%;
     }
     transform: translate(-50%, -50%);
    .video-load-btn {
    padding: 10px 20px;
        /* No need for absolute positioning with flexbox centering */
    background: #4285f4;
        padding: 10px 20px;
    color: white;
        background: #4285f4;
    border: none;
        color: white;
    border-radius: 4px;
        border: none;
    cursor: pointer;
        border-radius: 4px;
    z-index: 10;
        cursor: pointer;
  }
        z-index: 10;
  .video-load-btn:hover {
        /* Removed transform and absolute positioning */
    background: #3367d6;
    }
  }
    .video-load-btn:hover {
  .video-player {
        background: #3367d6;
    width: 100%;
    }
    height: 100%;
    .video-player {
    display: none;
        width: 100%;
  }
        height: 100%;
        display: none;
        /* When video is loaded, it will take full space within the flex container */
    }
</style>
</style>


<div class="video-container">
<div class="video-container">
  <!-- Button will be removed after click -->
    <div class="video-button-wrapper" style="text-align: center; padding: 20px;">
  <button class="video-load-btn"  
        <button class="video-load-btn"
          onclick="this.nextElementSibling.style.display='block'; this.nextElementSibling.src='<!--{$url|validate:url|escape:html|regex_replace:"#^(?!(https?:)?//).*#i":''}-->'; this.remove()">
                onclick="this.closest('.video-container').querySelector('.video-player').style.display='block'; this.closest('.video-container').querySelector('.video-player').src=''; this.parentNode.remove()">
    ▶ Load Video
            ▶ Load Video
  </button>
        </button>
  <!-- Video element (hidden by default) -->
    </div>
  <video class="video-player"  
    <video class="video-player"
        width="<!--{$width|default:425|validate:int|escape:'html'}-->"  
            width=""
        height="<!--{$height|default:355|validate:int|escape:'html'}-->"  
            height=""
        controls  
            controls
        preload="none"></video>
            preload="none"></video>
</div>
</div>
</includeonly>
</includeonly>

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

{{#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:视频.