Ziggeo API (https://ziggeo.com) allows you to integrate video recording and playback with only two lines of code in your site, service or app. This is the PHP Server SDK repository.
Pull requests welcome.
For the client-side integration, you need to add these assets to your html file:
<link rel="stylesheet" href="//assets-cdn.ziggeo.com/v1-latest/ziggeo.css" />
<script src="//assets-cdn.ziggeo.com/v1-latest/ziggeo.js"></script>
Then, you need to specify your api token:
<script>
ZiggeoApi.token = "APPLICATION_TOKEN";
</script>
You can specify other global options, see here.
To fire up a recorder on your page, add:
<ziggeo></ziggeo>
To embed a player for an existing video, add:
<ziggeo ziggeo-video='video-token'></ziggeo>
For the full documentation, please visit ziggeo.com.
You can integrate the Server SDK as follows:
<?php require_once('./ziggeo/Ziggeo.php');
$ziggeo = new Ziggeo('*token*', '*private_key*', '*encryption_key*'); ?>
The videos resource allows you to access all single videos. Each video may contain more than one stream.
Query an array of videos (will return at most 50 videos by default). Newest videos come first.
$ziggeo->videos()->index($arguments = array())
Arguments
- limit: Limit the number of returned videos. Can be set up to 100.
- skip: Skip the first [n] entries.
- reverse: Reverse the order in which videos are returned.
- states: Filter videos by state
- tags: Filter the search result to certain tags, encoded as a comma-separated string
Get a single video by token or key.
$ziggeo->videos()->get($token_or_key)
Download the video data file
$ziggeo->videos()->download_video($token_or_key)
Download the image data file
$ziggeo->videos()->download_image($token_or_key)
Push a video to a provided push service.
$ziggeo->videos()->push_to_service($token_or_key, $arguments = array())
Arguments
- pushservicetoken: Push Services's token (from the Push Services configured for the app)
Update single video by token or key.
$ziggeo->videos()->update($token_or_key, $arguments = array())
Arguments
- min_duration: Minimal duration of video
- max_duration: Maximal duration of video
- tags: Video Tags
- key: Unique (optional) name of video
- volatile: Automatically removed this video if it remains empty
- expiration_days: After how many days will this video be deleted
Delete a single video by token or key.
$ziggeo->videos()->delete($token_or_key)
Create a new video.
$ziggeo->videos()->create($arguments = array())
Arguments
- file: Video file to be uploaded
- min_duration: Minimal duration of video
- max_duration: Maximal duration of video
- tags: Video Tags
- key: Unique (optional) name of video
- volatile: Automatically removed this video if it remains empty
The streams resource allows you to directly access all streams associated with a single video.
Return all streams associated with a video
$ziggeo->streams()->index($video_token_or_key, $arguments = array())
Arguments
- states: Filter streams by state
Get a single stream
$ziggeo->streams()->get($video_token_or_key, $token_or_key)
Download the video data associated with the stream
$ziggeo->streams()->download_video($video_token_or_key, $token_or_key)
Download the image data associated with the stream
$ziggeo->streams()->download_image($video_token_or_key, $token_or_key)
Push a stream to a provided push service.
$ziggeo->streams()->push_to_service($video_token_or_key, $token_or_key, $arguments = array())
Arguments
- pushservicetoken: Push Services's token (from the Push Services configured for the app)
Delete the stream
$ziggeo->streams()->delete($video_token_or_key, $token_or_key)
Create a new stream
$ziggeo->streams()->create($video_token_or_key, $arguments = array())
Arguments
- file: Video file to be uploaded
Attaches an image to a new stream
$ziggeo->streams()->attach_image($video_token_or_key, $token_or_key, $arguments = array())
Arguments
- file: Image file to be attached
Attaches a video to a new stream
$ziggeo->streams()->attach_video($video_token_or_key, $token_or_key, $arguments = array())
Arguments
- file: Video file to be attached
Closes and submits the stream
$ziggeo->streams()->bind($video_token_or_key, $token_or_key, $arguments = array())
The auth token resource allows you to manage authorization settings for video objects.
Get a single auth token by token.
$ziggeo->authtokens()->get($token)
Update single auth token by token.
$ziggeo->authtokens()->update($token_or_key, $arguments = array())
Arguments
- volatile: Will this object automatically be deleted if it remains empty?
- hidden: If hidden, the token cannot be used directly.
- expiration_date: Expiration date for the auth token
- usage_experitation_time: Expiration time per session
- session_limit: Maximal number of sessions
- grants: Permissions this tokens grants
Delete a single auth token by token.
$ziggeo->authtokens()->delete($token_or_key)
Create a new auth token.
$ziggeo->authtokens()->create($arguments = array())
Arguments
- volatile: Will this object automatically be deleted if it remains empty?
- hidden: If hidden, the token cannot be used directly.
- expiration_date: Expiration date for the auth token
- usage_experitation_time: Expiration time per session
- session_limit: Maximal number of sessions
- grants: Permissions this tokens grants
Copyright (c) 2013-2017 Ziggeo
Apache 2.0 License