This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
- Domain filtering
- Referrer filtering
- Embed buster
function toUTF8Array(str) { | |
var utf8 = []; | |
for (var i=0; i < str.length; i++) { | |
var charcode = str.charCodeAt(i); | |
if (charcode < 0x80) utf8.push(charcode); | |
else if (charcode < 0x800) { | |
utf8.push(0xc0 | (charcode >> 6), | |
0x80 | (charcode & 0x3f)); | |
} | |
else if (charcode < 0xd800 || charcode >= 0xe000) { |
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
<link media="all" rel="stylesheet" href="https://unpkg.com/[email protected]/dist/video-js.css"> | |
<script src="https://unpkg.com/[email protected]/dist/video.js"></script> | |
<video-js id="player"> | |
<source src="//video/index.m3u8" type="application/x-mpegURL" /> | |
</video-js> | |
<script> | |
var player = videojs("player"); | |
var prefix = "key://"; | |
var urlTpl = "https://domain.com/path/{key}"; |
It turns out that some kind hearted people already set up wildcarded domains for you already. You can use any domain below and/or any subdomain of these and they will always resolve back to 127.0.0.1 (your local machine). Here's the list of ones I know about. Let me know if there are more!
localhost
- It will always works. Do you know why? I hope so.[*.]fuf.me
- Managed by @fidian; it will always point to localhost for IPv4 and IPv6[*.]localtest.me
[*.]127-0-0-1.org.uk
[*.]vcap.me
[*.]yoogle.com
<?php | |
/** | |
* Asssign any elementor widget to a different category | |
* | |
* To override the existing category just pass [ 'your-custom-category' ] | |
* And to keep existing [ 'your-custom-category', 'basic' ] | |
* here 'your-custom-category' is any registered category slug | |
* | |
* @param array $config |
<?php | |
/** | |
* Disable elementor registered widget. | |
* | |
* This will disable all WordPress native widgets | |
* | |
* @param \Elementor\Widgets_Manager $widgets_manager Instance of elementor widgets manager | |
* | |
* @author obiPlabon <https://obiPlabon.im> | |
* |
//data source = https://gist.github.com/hasinhayder/7352ac2d76660862061ffdd0d963711e | |
const videos = course.data.chapters | |
.map((chapter) => chapter.episodes.map((episode) => episode.vid)) | |
.flat() | |
//Another solution (By Shadman Shadab) | |
const videos = course.data.chapters | |
.flatMap((chapter) => chapter.episodes.map((episode) => episode.vid)) |
<VirtualHost *:80> | |
DocumentRoot (Your root folder here) | |
ServerName (ServerName Details Here) | |
.. | |
<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|svg)$"> | |
Header set Cache-Control "max-age=31536000, public" | |
</FilesMatch> | |
.. | |
</VirtualHost> |
<ifmodule mod_deflate.c> | |
#DeflateCompressionLevel 9 | |
# Compress HTML, CSS, JavaScript, Text, XML and fonts | |
AddOutputFilterByType DEFLATE image/svg+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
AddOutputFilterByType DEFLATE application/x-font | |
AddOutputFilterByType DEFLATE application/x-font-opentype | |
AddOutputFilterByType DEFLATE application/x-font-otf |