1. Enable stream API in config.php: define('OB_STREAM_API',true);


2. Run transcode.sh in background (suggest @reboot cron entry).


3. Alias stream directory to /streams/ and add Access-Control-Allow-Origin: *

      Lighttpd Example:
      
          $HTTP["url"] =~ "^/streams/" {
            setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
          }
          $HTTP["url"] =~ "^/tools/stream/captions" {
            setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
          }
          alias.url = ("/streams/" => "/path/to/cache/streams/")

      Apache2 Example:
      
          Alias "/streams" "/path/to/cache/streams"
          <Directory /path/to/cache/streams>
                  Require all granted
                  Header set Access-Control-Allow-Origin "*"
          </Directory>
          <Directory /path/to/tools/stream/captions>
                  Header set Access-Control-Allow-Origin "*"
          </Directory>
          

4. On website, add following code (for example) for public media browsing and streaming:

<script id="ob-stream-script">
  obstream = {};
  obstream.url = "https://example.com"
  obstream.genreSortBy = "name";
  obstream.genreSortDir = "desc";
  obstream.genreDisplay = "description"
  obstream.itemSortBy = "metadata_date";
  obstream.itemSortDir = "desc";
  obstream.itemDisplay = "title";
  var newScript = document.createElement("script");
  newScript.defer = true;
  newScript.src = "https://example/tools/stream/stream.js?v="+Date.now();
  var thisScript = document.getElementById('ob-stream-script');
  thisScript.parentNode.insertBefore(newScript, thisScript);
</script>
<div class="ob-stream-widget" data-category="1"></div>
