Template:HLSVideo

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Revision as of 22:51, 19 February 2026 by Magent (talk | contribs) (Create HLS video player template for IPFS-hosted videos (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

HLS Video Player

Embeds an HLS video from IPFS using hls.js.

Usage

{{HLSVideo|cid=QmXet6QwZ7qdtDn89Kn4fzdm7LugpcmQoSzchdij4V3DLB}}

Parameters

  • cid - Required. The IPFS CID containing the HLS directory (must have master.m3u8)
  • width - Optional. Video width (default: 100%)
  • height - Optional. Video height (default: auto)
  • gateway - Optional. IPFS gateway URL (default: https://ipfs.maybelle.cryptograss.live/ipfs)

Example

<video id="hls-video-QmXet6QwZ7qdtDn89Kn4fzdm7LugpcmQoSzchdij4V3DLB" controls playsinline style="width: 100%; height: auto; background: #000;"></video> <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> <script> (function() {

 var video = document.getElementById('hls-video-QmXet6QwZ7qdtDn89Kn4fzdm7LugpcmQoSzchdij4V3DLB');
 var src = 'https://ipfs.maybelle.cryptograss.live/ipfs/QmXet6QwZ7qdtDn89Kn4fzdm7LugpcmQoSzchdij4V3DLB/master.m3u8';
 
 if (video.canPlayType('application/vnd.apple.mpegurl')) {
   // Native HLS support (Safari)
   video.src = src;
 } else if (Hls.isSupported()) {
   var hls = new Hls();
   hls.loadSource(src);
   hls.attachMedia(video);
 } else {
video.parentElement.innerHTML = '

HLS not supported in this browser

';
 }

})(); </script>