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
| <?php | |
| /** | |
| * Gets the primary term of a post, by taxonomy. | |
| * If Yoast Primary Term is used, return it, | |
| * otherwise fallback to the first term. | |
| * | |
| * @version 1.3.0 | |
| * | |
| * @link https://gist.github.com/JiveDig/5d1518f370b1605ae9c753f564b20b7f |
| #user nobody; | |
| worker_processes 4; | |
| #error_log logs/error.log; | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; |
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:
| <?php | |
| /* | |
| Hi! | |
| So this gist is not a very good implementation, it works great in chrome but the seeking is sort of glitched in firefox. | |
| But it does the job and I hope it can help out! | |
| (Please let me know how to improve this) | |
| */ | |
| ini_set('max_execution_time', 0); | |
| $url = "http://mirrors.standaloneinstaller.com/video-sample/jellyfish-25-mbps-hd-hevc.m4v"; //just some sample url, please dont overload their servers |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| <script type="text/javascript"> | |
| var currentPosition = 0; | |
| if (localStorage.currentPlayerPosition) { | |
| currentPosition = localStorage.currentPlayerPosition; | |
| } | |
| player.once('play', function (){ | |
| 'use strict'; | |
| if (currentPosition > 0 && Math.abs(player.getDuration() - currentPosition) > 5) { | |
| player.seek(currentPosition); | |
| } |
| #!/bin/bash | |
| VERSION="1.0.2" | |
| # Interface connect to out lan | |
| INTERFACE="eth0" | |
| # Interface virtual for incomming traffic | |
| VIRTUAL="ifb0" | |
| # set the direction (1 = outgoing only, 2 = incoming only 3 = both) | |
| DIRECTION=3 | |
| # Speed |
| <?php | |
| /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
| /* Remove Yoast SEO Change existing title or meta template variable | |
| * Credit: Moshe Harush | |
| * https://stackoverflow.com/questions/36281915/yoast-seo-how-to-create-custom-variables | |
| * Last Tested: Unknown | |
| */ | |
| // define the wpseo_replacements callback | |
| function filter_wpseo_replacements( $replacements ) { |
| #!/bin/bash | |
| function echo_mem_stat () { | |
| mem_total="$(free | grep 'Mem:' | awk '{print $2}')" | |
| free_mem="$(free | grep 'Mem:' | awk '{print $7}')" | |
| mem_percentage=$(($free_mem * 100 / $mem_total)) | |
| swap_total="$(free | grep 'Swap:' | awk '{print $2}')" | |
| used_swap="$(free | grep 'Swap:' | awk '{print $3}')" | |
| swap_percentage=$(($used_swap * 100 / $swap_total)) |
| add_filter( 'generate_post_date_output', 'tu_show_modified_date' ); | |
| function tu_show_modified_date() { | |
| $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>'; | |
| if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { | |
| $time_string = 'Updated on: <time class="updated" datetime="%3$s" itemprop="dateModified">%4$s</time>'; | |
| } | |
| $time_string = sprintf( $time_string, | |
| esc_attr( get_the_date( 'c' ) ), |