Code Monkey home page Code Monkey logo

wse-rest-library-php's Introduction

PHP REST Library for Wowza Streaming Engine

Wowza Streaming Engine media server software includes a REST API that you can wrap with a PHP library to configure, manage, and monitor your streaming media server through PHP requests.

Prerequisites

Wowza Streaming Engine™ 4.0.0 or later is required. composer is highly recommended.

Composer Setup

  1. Please install composer

  2. Create a composer.json file in the root directory of your project or as appropriate.

composer.json example contents -

{
  "repositories": [
    {
      "type":"vcs",
      "url": "https://github.com/WowzaMediaSystems/wse-rest-library-php.git"
    }
  ],
  "require": {
    "wowza/wse-rest-library-php": "dev-master"
  },
  "minimum-stability": "dev",
  "prefer-stable": true
}

Installing wse-rest-library-php

composer install is the command you would run after composer is installed. This command must be ran in the same directory that the composer.json file is stored. Please see the composer site for issues with their product. Wowza Media Systems, LLC is not responsible for nor does it provide support for composer.

Example Configuration

index.php

<?php
//index.php

require_once(__DIR__.'/../vendor/autoload.php');

// This is for a framework if you use one.
//$framework = new Project\Framework();
//$framework->registerDebugHandlers();
//$framework->processHttpSapiRequest();

require_once("../config.php"); // make sure this exists and is similar to the below - move it where it needs to be

config.php

<?php
// config.php
define("WOWZA_HOST","http://111.111.123.123:8087/v2");
define("WOWZA_SERVER_INSTANCE", "_defaultServer_");
define("WOWZA_VHOST_INSTANCE", "_defaultVHost_");
define("WOWZA_USERNAME", "my_secret_username");
define("WOWZA_PASSWORD", "my_super_cool_password");

// It is simple to create a setup object for transporting our settings
$setup = new Com\Wowza\Entities\Application\Helpers\Settings();
$setup->setHost(WOWZA_HOST);
$setup->setUsername(WOWZA_USERNAME);
$setup->setPassword(WOWZA_PASSWORD);

// Connect to the server or deal with statistics NOTICE THE CAPS IN COM AND WOWZA
$server = new Com\Wowza\Server($setup);
$sf = new Com\Wowza\Statistics($setup);
$response = $sf->getServerStatistics($server);
var_dump($response);

Packagist

Work is being done to make this repository available through packagist.

Usage

To learn the basics of how to query the Wowza Streaming Engine REST service using PHP, see How to use PHP to make requests to the Wowza Streaming Engine REST API. For examples on how to leverage this PHP library, see REST API Query Examples (PHP).

More resources

Wowza Media Systems™ provides developers with a platform to create streaming applications and solutions. See Wowza Developer Tools to learn more about our APIs and SDK.

Contact

Wowza Media Systems, LLC

License

This code is distributed under the Wowza Public License.

alt tag

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.