Collection of solutions for streaming via DASH, Dynamic Adaptive Streaming over HTTP, as of November 2014.
Recommended client: Chrome 38
Tool used for encoding live streams: FFmpeg
| // | |
| // File: inotify-example.cpp | |
| // Date: July 16, 2013 | |
| // Author: Peter Krnjevic <[email protected]>, on the shoulders of many others | |
| // | |
| // This is a simple inotify sample program monitoring changes to "./tmp" directory (create ./tmp beforehand) | |
| // Recursive monitoring of file and directory create and delete events is implemented, but | |
| // monitoring pre-existing "./tmp" subfolders is not. | |
| // A C++ class containing a couple of maps is used to simplify monitoring. | |
| // The Watch class is minimally integrated, so as to leave the main inotify code |
| #include <dirent.h> | |
| #include <iterator> | |
| #include <cstdlib> | |
| #include <cstring> | |
| #include <sstream> | |
| #include <iostream> | |
| #include <stdlib.h> | |
| #include <string> | |
| #include <sys/stat.h> | |
| #include <syslog.h> |
| using UnityEngine; | |
| using System.Collections; | |
| public class SmoothFollow2D : MonoBehaviour { | |
| //offset from the viewport center to fix damping | |
| public float m_DampTime = 10f; | |
| public Transform m_Target; | |
| public float m_XOffset = 0; | |
| public float m_YOffset = 0; |
| upstream project { | |
| server 22.22.22.2:3000; | |
| server 22.22.22.3:3000; | |
| server 22.22.22.5:3000; | |
| } | |
| server { | |
| listen 80; | |
| location / { |
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |
| // Queue class for serializing AJAX calls. | |
| // | |
| // Inspired by Raynos http://stackoverflow.com/a/4797596/1194060 | |
| // | |
| // Queue has a public append method that expects some kind of task. | |
| // A task is a generic function passed as callback. | |
| // Constructor expects a handler which is a method that takes a ajax task | |
| // and a callback. Queue expects the handler to deal with the ajax and run | |
| // the callback when it's finished |
| upstream plex-upstream { | |
| # change plex-server.example.com:32400 to the hostname:port of your plex server. | |
| # this can be "localhost:32400", for instance, if Plex is running on the same server as nginx. | |
| server plex-server.example.com:32400; | |
| } | |
| server { | |
| listen 80; | |
| # server names for this server. |
| /// | |
| /// Simple pooling for Unity. | |
| /// Author: Martin "quill18" Glaude ([email protected]) | |
| /// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267 | |
| /// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/) | |
| /// UPDATES: | |
| /// 2015-04-16: Changed Pool to use a Stack generic. | |
| /// | |
| /// Usage: | |
| /// |
| /*global console window describe xdescribe it expect runs waits*/ | |
| (function () { | |
| require.paths.unshift(__dirname + '/../../../'); | |
| require('thorny/base')('./config/default.json')(function ($) { | |
| describe('a vector2', function () { | |
| it('should contain the following functions', function () { | |
| var vector2 = $('thorny math vector2'); | |
| expect(typeof vector2.factory).toEqual('function'); | |
| expect(typeof vector2.centroid).toEqual('function'); |