### Example: Get application stats script Source: https://ziggeo.com/docs/sdks/server-side/php/application A complete script example demonstrating how to initialize the SDK and fetch application statistics. ```php application()->get_stats(); var_dump($result); ?> ``` -------------------------------- ### Example: Create a webhook Source: https://ziggeo.com/docs/sdks/server-side/node/webhooks A complete example demonstrating how to create a webhook using command-line arguments for configuration. ```javascript /* Usage: node webhooks_create.js APP_TOKEN PRIVATE_KEY TARGET_URL ENCODING "EVENTS1,EVENTS2" Sample: node webhooks_create.js 1234567890abcdef 1234567890abcdef http://example.com jsonheader video_delete,video_create */ var app_token = process.argv[2]; var private_key = process.argv[3]; var target_url = process.argv[4]; var encoding = process.argv[5]; var events = process.argv[6]; var Ziggeo = require("../index.js"); var ZiggeoSdk = new Ziggeo(app_token, private_key); var options = { target_url: target_url, encoding: encoding, // json, form, jsonheader events: events } ZiggeoSdk.Webhooks.create(options,{ success: function(data){ console.log("Created webhook token "+data); }, failure: function(error){ console.log(error); } }); ``` -------------------------------- ### Install Framework via Pods Source: https://ziggeo.com/docs/sdks/mobile/swift Command to install the defined pods. ```bash $ pod install ``` -------------------------------- ### Size Strategy Examples Source: https://ziggeo.com/docs/dashboard/profiles/video-profiles/create-profile Examples demonstrating how different size strategies (keep, shrink, stretch) affect a 300x240 source video when targeting a 640x480 resolution. ```text Lets check out an example: target - 640x480 SD source - 300x240 SD keep > 300x240 is turned into 640x480 shrink > 300x240 is turned into 300x240 stretch > 300x240 is turned into 640x480 ``` -------------------------------- ### Ratio Strategy Examples Source: https://ziggeo.com/docs/dashboard/profiles/video-profiles/create-profile Examples demonstrating how different ratio strategies (fixed, shrink, stretch) affect a 300x240 source video when targeting a 640x480 resolution. ```text Lets check out an example: target - 640x480 SD source - 300x240 SD fixed > 300x240 is turned into 640x480 (depending on other options, it could be distorted, or cut) shrink > 300x240 is turned into 600x480 (one size is shrunk to keep aspect ratio) stretch > 300x240 is turned into 640x512 ``` -------------------------------- ### Automatic Installation Source: https://ziggeo.com/docs/sdks/mobile/react-native Standard installation commands for the React Native Ziggeo library. ```bash $ npm install react-native-ziggeo-library --save $ react-native link ``` -------------------------------- ### Setup Ziggeo in VueJS Source: https://ziggeo.com/docs/sdks/javascript/integrations/vue Install the package and register the Ziggeo plugin in your main application file. ```javascript import { createApp } from 'vue'; import Ziggeo from 'vue-ziggeo'; // You have to import css files from node directory // Or you can import inside in your component import "@node_modules/vue-ziggeo/dist/vue-ziggeo.css"; createApp(YOUR_MAIN_APP_COMPONENT).use(Ziggeo).mount("#root_index_html_id_selector"); ``` -------------------------------- ### Start recording Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Begins the recording process. ```javascript embedding.record(); ``` -------------------------------- ### Create stream example Source: https://ziggeo.com/docs/sdks/server-side/php/video-streams Demonstrates how to initialize the SDK and create a stream by uploading a file. ```php streams()->create($opts["video_token"], array( "file" => $opts["file_path"] )); ?> ``` -------------------------------- ### Initialize RecorderConfig Builder Source: https://ziggeo.com/docs/sdks/mobile/android The starting point for all recorder configurations. ```java RecorderConfig.Builder configBuilder = new RecorderConfig.Builder(); ``` -------------------------------- ### Start Screen Recorder Source: https://ziggeo.com/docs/sdks/mobile/android Initiate a foreground service for screen recording. ```java /** * Start foreground service for screen recording and screen recording */ ziggeo.startScreenRecorder(@Nullable ScreenRecordServiceNotificationConfig config); ``` -------------------------------- ### Install CocoaPods Source: https://ziggeo.com/docs/sdks/mobile/swift Command to install the CocoaPods dependency manager. ```bash $ sudo gem install cocoapods ``` -------------------------------- ### embedding.record_screen() Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts screen recording. ```APIDOC ## embedding.record_screen() ### Description Starts screen recording. ``` -------------------------------- ### Create a webhook example Source: https://ziggeo.com/docs/sdks/server-side/python/webhooks A complete script demonstrating how to create a webhook using command-line arguments. ```python import sys from Ziggeo import Ziggeo if(len(sys.argv) < 6): print ("Error\n") print ("Usage: $>python webhooks_create.py YOUR_API_TOKEN YOUR_PRIVATE_KEY WEBHOOK_URL ENCODING EVENTS\n") print ("Example: $>python webhooks_create.py 1234567890abcdef 1234567890abcdef http://yoursite.com jsonheader video_create,video_delete\n") sys.exit() api_token = sys.argv[1] private_key = sys.argv[2] target_url = sys.argv[3] encoding = sys.argv[4] # jsonheader, json, or form events = sys.argv[5] ziggeo = Ziggeo(api_token, private_key) arguments = {} arguments['target_url'] = target_url arguments['encoding'] = encoding arguments['events'] = events print(arguments) webhooks = ziggeo.webhooks().create(arguments) print(webhooks) ``` -------------------------------- ### Start screen recording Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Initiates screen recording. ```javascript embedding.record_screen(); ``` -------------------------------- ### Create a meta profile Source: https://ziggeo.com/docs/sdks/server-side/python/meta-profiles Method signature and a complete example for creating a new meta profile. ```python ziggeo.metaProfiles().create(arguments = None) ``` ```python import sys from Ziggeo import Ziggeo if(len(sys.argv) < 3): print ("Error\n") print ("Usage: $>python metaprofiles_create.py YOUR_API_TOKEN YOUR_PRIVATE_KEY METAPROFILE_TITLE\n") sys.exit() api_token = sys.argv[1] private_key = sys.argv[2] metaprofiles_title = sys.argv[3] ziggeo = Ziggeo(api_token, private_key) arguments = {} arguments['title'] = metaprofiles_title metaprofiles = ziggeo.metaProfiles().create(arguments) print(metaprofiles) ``` -------------------------------- ### embedding.record_video() Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts camera recording. ```APIDOC ## embedding.record_video() ### Description Starts camera recording. ``` -------------------------------- ### startScreenRecorder(ScreenRecordServiceNotificationConfig config) Source: https://ziggeo.com/docs/sdks/mobile/android Starts the foreground service for screen recording. ```APIDOC ## startScreenRecorder(ScreenRecordServiceNotificationConfig config) ### Description Starts the foreground service for screen recording. ### Parameters - **config** (ScreenRecordServiceNotificationConfig) - Optional - Configuration for the screen recording service notification. ``` -------------------------------- ### embedding.record_audio() Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts microphone recording. ```APIDOC ## embedding.record_audio() ### Description Starts microphone recording. ``` -------------------------------- ### Start camera recording Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Initiates camera recording. ```javascript embedding.record_video(); ``` -------------------------------- ### playing() Source: https://ziggeo.com/docs/sdks/mobile/android Fires any time playback is started. ```APIDOC ## void playing() ### Description Fires any time a playback is started ``` -------------------------------- ### get Source: https://ziggeo.com/docs/sdks/server-side/ruby/effect-profiles Retrieves a single process by its token or key. ```APIDOC ## ziggeo.effectProfileProcess().get(effect_token_or_key, token_or_key) ### Description Get a single process associated with an effect profile. ### Parameters - **effect_token_or_key** (string) - Required - The token or key of the effect profile. - **token_or_key** (string) - Required - The token or key of the process. ``` -------------------------------- ### Start audio recording Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Initiates microphone recording. ```javascript embedding.record_audio(); ``` -------------------------------- ### Configure and Start QR Scanner Source: https://ziggeo.com/docs/sdks/mobile/android Set the configuration for the QR scanner and initiate the scanning process. ```java ziggeo.setQrScannerConfig(...) ziggeo.startQrScanner(); ``` -------------------------------- ### Ziggeo.IZiggeoPlayer.Play Source: https://ziggeo.com/docs/sdks/mobile/xamarin Starts the player for an existing video using its token. ```APIDOC ## Play ### Description Starts the player for an existing video. ### Method `await player.Play(string token)` ### Parameters - **token** (string) - The token or key of the video to play. ``` -------------------------------- ### $ziggeo->application()->get() Source: https://ziggeo.com/docs/sdks/server-side/php/application Retrieves the current application details. ```APIDOC ## $ziggeo->application()->get() ### Description Reads the application details. ### Method SDK Method ### Response Returns a JSON object containing the application details. ``` -------------------------------- ### Start playback Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Initiates playback of a recorded video. ```javascript embedding.play(); ``` -------------------------------- ### Get Single Stream Details Source: https://ziggeo.com/docs/sdks/server-side/php/video-streams Retrieves details for a specific stream. Includes a full example script for fetching stream information. ```php $ziggeo->streams()->get($video_token_or_key, $token_or_key) ``` ```php streams()->get($opts["video_token"], $opts["video_stream"]); var_dump($result); ?> ``` -------------------------------- ### Make GET Request and Get String Response Source: https://ziggeo.com/docs/sdks/mobile/swift Executes a GET request and returns the response as a string. ```swift connection.GetStringWithPath(path: String, data: NSDictionary?, callback: { (string, response, error) in //the string contains stringified response received from Ziggeo API Server }) ``` -------------------------------- ### Implement Custom Device Selection with Ziggeo Recorder Source: https://ziggeo.com/docs/how-tos/javascript/custom-camera-microphone-fields This example demonstrates how to initialize a Ziggeo recorder and populate custom dropdown menus with available camera and microphone devices. It includes event listeners to handle device switching and UI updates based on recorder state. ```html
``` -------------------------------- ### uploadingStarted(String videoToken) Source: https://ziggeo.com/docs/sdks/mobile/android Triggered when the video upload process has started. ```APIDOC ## void uploadingStarted(String videoToken) ### Description Triggered when a video uploadingStarted has started ### Parameters - **videoToken** (String) - Required - The token of the video being uploaded ``` -------------------------------- ### Initialize Pods Source: https://ziggeo.com/docs/sdks/mobile/swift Command to initialize a new Podfile in the project directory. ```bash $ pod init ``` -------------------------------- ### iOS Podfile Installation Source: https://ziggeo.com/docs/sdks/mobile/react-native Dependencies required for iOS installation via CocoaPods. ```ruby pod 'ZiggeoRN', :git => 'https://github.com/Ziggeo/ReactNativeSDK.git' pod 'iOS-Client-SDK', :git => 'https://github.com/Ziggeo/iOS-Client-SDK.git' ``` -------------------------------- ### Retrieve analytics data example Source: https://ziggeo.com/docs/sdks/server-side/php/analytics A complete script demonstrating how to initialize the SDK and fetch analytics data using command-line arguments. ```php analytics()->get(array( "from" => (isset($opts["filter_from"])) ? $opts["filter_from"] : NULL, "to" => (isset($opts["filter_to"])) ? $opts["filter_to"] : NULL, "date" => (isset($opts["filter_date"])) ? $opts["filter_date"] : NULL, "query" => $opts["filter_query"] )); var_dump($analytics); ?> ``` -------------------------------- ### JSON response example for index method Source: https://ziggeo.com/docs/sdks/server-side/csharp/videos Example of the JSON structure returned by the index method. ```json [ { "volatile":false, "token":"a7edab8c635ec37047d8ae75411528e3", "key":null, "state":5, "max_duration":null, "duration":1, "tags":null, "submission_date":1390257799, "resubmission_date":1390257799, "stream_submission_date":1390257799, "delete_old_streams":true, "type":"ApiVideo", "created":1390257798, "owned":false, "state_string":"READY", "streams":[ { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }], "original_stream": { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }, "default_stream": { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" }}] ``` -------------------------------- ### Create a Meta Profile and NSFW Process in PHP Source: https://ziggeo.com/docs/sdks/server-side/php/meta-profiles Demonstrates initializing the Ziggeo SDK, creating a meta profile, and attaching an NSFW process with a rejection action. ```php metaProfiles()->create(array( "title" => $opts["meta_title"], "key" => (!empty($opts["meta_key"])) ? $opts["meta_key"] : null )); $ziggeo->metaProfileProcess()->create_nsfw_process($metaprofiles->token, array("nsfw_action"=>"reject")); ?> ``` -------------------------------- ### Get application details Source: https://ziggeo.com/docs/sdks/server-side/php/application Retrieves the current application configuration as a JSON object. ```php $ziggeo->application()->get() ``` -------------------------------- ### Ziggeo(String appToken, Context context) Source: https://ziggeo.com/docs/sdks/mobile/android Initializes the Ziggeo SDK instance. ```APIDOC ## Ziggeo(String appToken, Context context) ### Description Initializes the Ziggeo SDK with the provided application token and context. ### Parameters - **appToken** (String) - Required - Ziggeo application token - **context** (Context) - Required - Application context ``` -------------------------------- ### startCameraRecorder() Source: https://ziggeo.com/docs/sdks/mobile/android Launches the standalone fullscreen camera recorder and player activity. ```APIDOC ## startCameraRecorder() ### Description Launches a standalone activity with the camera recorder and player. ``` -------------------------------- ### Initialize Ziggeo SDK Source: https://ziggeo.com/docs/sdks/server-side Standard initialization patterns for Ziggeo server-side SDKs using application credentials. ```php ``` ```python ziggeo = Ziggeo("YOUR APP TOKEN", "YOUR_APP_PRIVATE_KEY", "YOUR_APP_ENCRYPTION_KEY") ``` ```javascript Ziggeo = require('ziggeo'); var ZiggeoSdk = new Ziggeo('YOUR APP TOKEN', 'YOUR_APP_PRIVATE_KEY', 'YOUR_APP_ENCRYPTION_KEY'); ``` ```ruby @ziggeo = Ziggeo.new("YOUR APP TOKEN", "YOUR_APP_PRIVATE_KEY", "YOUR_APP_ENCRYPTION_KEY") ``` ```java Ziggeo ziggeo = new Ziggeo("YOUR APP TOKEN", "*privateKey*", "*encryptionKey*"); ``` ```csharp Ziggeo ziggeo = new Ziggeo("YOUR APP TOKEN", "YOUR_APP_PRIVATE_KEY", "YOUR_APP_ENCRYPTION_KEY"); ``` -------------------------------- ### Index videos example script Source: https://ziggeo.com/docs/sdks/server-side/ruby/videos A complete script demonstrating how to list all videos from an application using pagination. ```ruby =begin This script shows you how to list all videos from your application. Parameters you need to pass: 1. APP_TOKEN 2. PRIVATE_KEY Example call: ruby videos_index.rb APP_TOKEN PRIVATE_KEY ruby videos_index.rb APP_TOKEN PRIVATE_KEY ENCRIPTION_KEY =end require_relative "../lib/Ziggeo" @ziggeo = Ziggeo.new(*ARGV) videos = [] skip = 0 limit = 100 loop do videos = @ziggeo.videos.index( "skip": skip, "limit": limit ) videos.each { |video| puts "Listing " + video["token"] skip += 1 } break if videos.length == 0 end ``` -------------------------------- ### embedding.record() Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Start recording process. ```APIDOC ## embedding.record() ### Description Start recording process. ``` -------------------------------- ### Full example: Create watermark process Source: https://ziggeo.com/docs/sdks/server-side/ruby/effect-profiles A complete script demonstrating how to create an effect profile and attach a watermark process to it. ```ruby =begin This script shows you how to attach effect process (like watermark) to the existing effect profile Please note that effect profile has to exist for this to work. It can be anything, we are using key to make it easier Parameters you need to pass: 1. APP_TOKEN 2. PRIVATE_KEY Example call: ruby effectprofileprocess_create_watermark_process.rb APP_TOKEN PRIVATE_KEY ruby effectprofileprocess_create_watermark_process.rb APP_TOKEN PRIVATE_KEY ENCRIPTION_KEY =end require_relative "../lib/Ziggeo" ziggeo = Ziggeo.new(*ARGV) =begin We first create the effect profile, unless we were to use some existing profile, in which case we would use its key or token instead and skip this step Will not be setting up a key at this time, rather let system make a token for us. =end opts_profile = { "title" => "Ruby SDK Made Effect Profile" } profile = ziggeo.effectProfiles().create( opts_profile ) puts profile =begin Would be object such as: { "volatile"=>false, "token"=>"3765534c0024b619d7d9a9966e2e08f2", "key"=>nil, "title"=>"Ruby SDK Made Effect Profile", "default_effect"=>false, "type"=>"ApiEffectProfile", "created"=>1587044236, "owned"=>false } =end opts_watermark = { "video_scale" => '0.25', "horizontal_position" => '0.95', "vertical_position" => '0.95'} watermark_path = "../sample/logo-white.png" watermark = ziggeo.effectProfileProcess().create_watermark_process(profile['token'], opts_profile, watermark_path) puts watermark ``` -------------------------------- ### embedding.play() Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Start playback of recorded video. ```APIDOC ## embedding.play() ### Description Start playback of recorded video. ``` -------------------------------- ### Trigger re-recording Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts the re-recording process. ```javascript embedding.rerecord(); ``` -------------------------------- ### Configure Camera and Microphone Selectors Source: https://ziggeo.com/docs/how-tos/javascript/custom-camera-microphone-fields Examples of setting up camera and microphone selection fields using the ziggeo-outsource-selectors attribute. ```html ziggeo-outsource-selectors="cam-id[disabled=false];mic-id[type='radio']" ``` ```html ziggeo-outsource-selectors="cam-id[type='radio',disabled=true,showCapabilities=true];mic-id[type='select',className='class1 class2']" ``` -------------------------------- ### Android Manual Installation Configuration Source: https://ziggeo.com/docs/sdks/mobile/react-native Configuration snippets for Android project files including settings.gradle, build.gradle, and AndroidManifest.xml. ```gradle include ':react-native-ziggeo-library' project(':react-native-ziggeo-library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ziggeo-library/android') ``` ```gradle maven { url 'https://jitpack.io' } ``` ```gradle compile project(':react-native-ziggeo-library') ``` ```xml xmlns:tools="http://schemas.android.com/tools" ``` ```xml tools:replace="android:name" ``` -------------------------------- ### Get All Videos Source: https://ziggeo.com/docs/sdks/mobile/ios Retrieve a list of all videos asynchronously. ```objective-c [videos indexWithData:nil Callback:^(NSArray *jsonArray, NSError *error) { //the completion block will be executed asynchronously on the response received NSLog(@"videos: %@\nerror: %@", jsonArray, error); }]; ``` -------------------------------- ### recordingStarted() Source: https://ziggeo.com/docs/sdks/mobile/android Triggered when the recording process has officially started. ```APIDOC ## void recordingStarted() ### Description Triggered when a recording process has started ``` -------------------------------- ### ZiggeoPlayer Initialization Source: https://ziggeo.com/docs/sdks/mobile/ios Methods to create a video player instance for playback. ```APIDOC ## ZiggeoPlayer Initialization ### Method `[[ZiggeoPlayer alloc] initWithZiggeoApplication:m_ziggeo videoToken:VIDEO_TOKEN]` ### Description Creates a standard player instance for a specific video token. ### Parameters - **m_ziggeo** (Ziggeo) - Required - The initialized Ziggeo application instance. - **VIDEO_TOKEN** (NSString) - Required - The token of the video to play. ``` -------------------------------- ### Initialize Local Repository Source: https://ziggeo.com/docs/integrations/heroku Initialize a new Git repository in the local project folder. ```bash git init ``` -------------------------------- ### embedding.upload_video(file) Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts the upload of a video file. ```APIDOC ## embedding.upload_video(file) ### Description Starts the upload of a video file. ### Parameters - **file** (File) - Required - The File Object to start the file upload. ``` -------------------------------- ### embedding.upload_covershot(file) Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts the upload of an image file. ```APIDOC ## embedding.upload_covershot(file) ### Description Starts the upload of an image file. ### Parameters - **file** (File) - Required - The File Object to start the file upload. ``` -------------------------------- ### embedding.upload_audio(file) Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts the upload of an audio file. ```APIDOC ## embedding.upload_audio(file) ### Description Starts the upload of an audio file. ### Parameters - **file** (File) - Required - The File Object to start the file upload. ``` -------------------------------- ### Basic Ziggeo Recorder Configuration Source: https://ziggeo.com/docs/how-tos/javascript/recording-hd-videos Initial setup of the Ziggeo recorder component before applying HD recording parameters. ```html ``` -------------------------------- ### Create a meta profile Source: https://ziggeo.com/docs/sdks/server-side/ruby/meta-profiles Initializes a new meta profile using the Ruby SDK. ```ruby ziggeo.metaProfiles().create(arguments = nil) ``` -------------------------------- ### readyToRecord() Source: https://ziggeo.com/docs/sdks/mobile/android Triggered when the camera is ready and permissions are granted, indicating that a recording can be initiated. ```APIDOC ## void readyToRecord() ### Description Gets triggered as soon as the recording can be made. (Camera is ready and permissions are granted) ``` -------------------------------- ### Implement ZiggeoRecorder in React Source: https://ziggeo.com/docs/sdks/javascript/integrations/react Demonstrates how to initialize the ZiggeoRecorder component and access the underlying instance using a ref. ```javascript import React from 'react' import {ZiggeoRecorder} from 'react-ziggeo' ... // after react-ziggeo 4.0.0 version hooks are applied, but class Component also supportis // Correct way to access to recorder/player instance is: const [recorder, setRecorder] = useState(null); useEffect(() => { if (recorder) { // DO stuff here recorder.on("any_event", function (rec) { ... }, recorder); recorder.get("attribute_name"); } }, [recorder]); // Embedding (player/recorder instance) will be the first argument const handleRecorderRecording = (embedding) => { console.log('Recorder onRecording'); }; const handleRecorderUploading = (embedding) => { console.log('Recorder uploading'); }; ... (setRecorder(ref))} /> ... ``` -------------------------------- ### Get video stats Source: https://ziggeo.com/docs/sdks/server-side/php/videos Retrieves statistics for a specific video. ```php $ziggeo->videos()->get_stats($token_or_key) ``` -------------------------------- ### ZiggeoRecorder Initialization Source: https://ziggeo.com/docs/sdks/mobile/ios Initializes and presents the standard Ziggeo video recorder. ```APIDOC ## ZiggeoRecorder ### Description Initializes the standard Ziggeo recorder with a Ziggeo application instance and presents it as a view controller. ### Code ```objectivec ZiggeoRecorder* recorder = [[ZiggeoRecorder alloc] initWithZiggeoApplication:m_ziggeo]; [self presentViewController:recorder animated:true completion:nil]; ``` ``` -------------------------------- ### Get Video Analytics Source: https://ziggeo.com/docs/sdks/server-side/node/videos Retrieves analytics for a specific video. ```javascript ZiggeoSdk.Videos.analytics(token_or_key, arguments, [callbacks]) ``` -------------------------------- ### Upload a video script Source: https://ziggeo.com/docs/sdks/server-side/ruby/videos A complete script example demonstrating how to upload a video file using the Ziggeo Ruby SDK. ```ruby =begin This script shows you how to upload a video. Parameters you need to pass: 1. APP_TOKEN 2. PRIVATE_KEY 3. FILE Example call: ruby videos_create.rb APP_TOKEN PRIVATE_KEY FILE =end require_relative "../lib/Ziggeo" puts Ziggeo.new(ARGV[0], ARGV[1]).videos.create(nil, ARGV[2]) ``` -------------------------------- ### Initialize Application Source: https://ziggeo.com/docs/sdks/mobile/ios Initializes the Ziggeo application instance using your unique application token. ```APIDOC ## Ziggeo Initialization ### Method `[[Ziggeo alloc] initWithToken:APP_TOKEN]` ### Description Initializes the Ziggeo SDK with your application token. ### Parameters - **APP_TOKEN** (NSString) - Required - Your Ziggeo application token. ``` -------------------------------- ### Initialize Ziggeo Source: https://ziggeo.com/docs/sdks/mobile/android Create a Ziggeo instance using your application token and context. ```java /** * @param appToken - Ziggeo application token * @param context - Application context */ Ziggeo ziggeo = new Ziggeo(appToken, context); ``` -------------------------------- ### Get a single stream Source: https://ziggeo.com/docs/sdks/server-side/node/video-streams Retrieves details for a single stream. ```javascript ZiggeoSdk.Streams.get(video_token_or_key, token_or_key, [callbacks]) ``` -------------------------------- ### Get a single stream Source: https://ziggeo.com/docs/sdks/server-side/csharp/video-streams Retrieves details for a specific stream. ```csharp ziggeo.streams().get(string video_token_or_key, string token_or_key) ``` -------------------------------- ### Subscribe to Application Ready Event Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/application-events Registers a callback that executes once the Ziggeo system is fully initialized and ready for use. ```javascript ziggeoApp.on("ready", function () { //Your code goes here }); ``` -------------------------------- ### GET /v1/applications/:application_token/videos/:video_token Source: https://ziggeo.com/docs/sdks/javascript/api Read an existing video. ```APIDOC ## [GET] /v1/applications/:application_token/videos/:video_token ### Description Read an existing video. ### Method GET ### Endpoint /v1/applications/:application_token/videos/:video_token ### Parameters #### Path Parameters - **video_token** (string) - Required - Token or a key identifying the video. ``` -------------------------------- ### Get parent width Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Returns the width of the container element. ```javascript embedding.parentWidth(); ``` -------------------------------- ### Retrieve analytics data example Source: https://ziggeo.com/docs/sdks/server-side/python/analytics A complete script demonstrating how to initialize the Ziggeo client and fetch analytics data based on command-line arguments. ```python import sys import time from Ziggeo import Ziggeo if(len(sys.argv) < 4): print ("Error\n") print ("Usage: $>python analytics_get.py YOUR_API_TOKEN YOUR_PRIVATE_KEY QUERY\n") print ("Example: $>python analytics_get.py 1234567890abcdef 1234567890abcdef device_view_by_os\n") sys.exit() api_token = sys.argv[1] private_key = sys.argv[2] query = sys.argv[3] ziggeo = Ziggeo(api_token, private_key) ts = time.time() arguments = {} arguments['from'] = 0 arguments['to'] = ts arguments['query'] = query print (ziggeo.analytics().get(arguments)) ``` -------------------------------- ### Bulk Update Videos in Ruby Source: https://ziggeo.com/docs/sdks/server-side/ruby/videos Example script for updating multiple videos by providing a comma-separated list of tokens or keys. ```ruby =begin This script shows you how to update more than one video at once. Parameters you need to pass: 1. APP_TOKEN 2. PRIVATE_KEY 3. VIDEO_TOKENS Example call: ruby videos_update_bulk.rb APP_TOKEN PRIVATE_KEY VIDEO_TOKEN1 VIDEO_TOKEN2 ... VIDEO_TOKENn =end require_relative "../lib/Ziggeo" app_token, private_key = ARGV.shift(2) video_tokens = ARGV.join(",") puts "Comma-separated list of tokens/keys: " + "\"" + video_tokens + "\"" @ziggeo = Ziggeo.new(app_token, private_key) result = @ziggeo.videos.update_bulk( tokens_or_keys: video_tokens, tags: "bulk_updated_with_sdk, ruby" ) puts result ``` -------------------------------- ### Get parent height Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Returns the height of the container element. ```javascript embedding.parentHeight(); ``` -------------------------------- ### $ziggeo->videos()->create($arguments) Source: https://ziggeo.com/docs/sdks/server-side/php/videos Creates a new video by uploading a file and setting optional parameters like duration, tags, and profiles. ```APIDOC ## $ziggeo->videos()->create($arguments) ### Description Creates a new video. You can provide a file path and various configuration options such as duration limits, tags, and profiles. ### Parameters - **file** (string) - Optional - Video file to be uploaded - **min_duration** (integer) - Optional - Minimal duration of video - **max_duration** (integer) - Optional - Maximal duration of video - **tags** (string) - Optional - Video Tags - **key** (string) - Optional - Unique name of video - **volatile** (boolean) - Optional - Automatically removed this video if it remains empty - **effect_profile** (string) - Optional - Set the effect profile to be applied - **meta_profile** (string) - Optional - Set the meta profile to be applied - **video_profile** (string) - Optional - Set the video profile to be applied ### Response Returns a JSON object containing video details such as token, state, and stream information. ``` -------------------------------- ### Listen to recording event Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/application-embedding-events Triggered when a recording process has started. ```javascript ziggeoApp.embed_events.on("recording", function (embedding) { //Your code goes here }); ``` -------------------------------- ### Upload covershot Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts the upload process for an image file. ```javascript embedding.upload_covershot(file); ``` -------------------------------- ### Create a Meta Profile Source: https://ziggeo.com/docs/sdks/server-side/node/meta-profiles Initializes a new meta profile using the specified key and title. ```javascript ZiggeoSdk.MetaProfiles.create(arguments, [callbacks]) ``` -------------------------------- ### $ziggeo->metaProfileProcess()->get($meta_token_or_key, $token_or_key) Source: https://ziggeo.com/docs/sdks/server-side/php/meta-profiles Retrieves a single process. ```APIDOC ## $ziggeo->metaProfileProcess()->get($meta_token_or_key, $token_or_key) ### Description Retrieves a single process associated with a meta profile. ### Parameters - **meta_token_or_key** (string) - Required - The token or key of the meta profile. - **token_or_key** (string) - Required - The token or key of the process. ``` -------------------------------- ### ZiggeoApi.V2.Application Initialization and Retrieval Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/application-events Methods to initialize a new application instance, retrieve the default instance, or look up an application by its token. ```APIDOC ## ZiggeoApi.V2.Application ### Initialization `new ZiggeoApi.V2.Application({token: "YOUR_APPLICATION_TOKEN"})` ### Get Default `ZiggeoApi.V2.Application.getDefault()` ### Get By Token `ZiggeoApi.V2.Application.getByToken("YOUR_APPLICATION_TOKEN")` ``` -------------------------------- ### $ziggeo->metaProfiles()->get($token_or_key) Source: https://ziggeo.com/docs/sdks/server-side/php/meta-profiles Retrieves a single meta profile. ```APIDOC ## $ziggeo->metaProfiles()->get($token_or_key) ### Description Retrieves details for a single meta profile by its token or key. ### Parameters - **token_or_key** (string) - Required - The token or key of the meta profile. ``` -------------------------------- ### Configure Embedding Parameters Source: https://ziggeo.com/docs/sdks/javascript/browser-integration/parameters Examples showing how to apply parameters like 'timelimit' using HTML attributes or JavaScript configuration objects. ```html ``` ```javascript new ZiggeoApi.V2.Player({ ..., attrs: { timelimit: 10 } }); ``` -------------------------------- ### startPlayer(Uri... path) / startPlayer(String... videoToken) Source: https://ziggeo.com/docs/sdks/mobile/android Launches the standalone fullscreen video player for local URIs or remote video tokens. ```APIDOC ## startPlayer(Uri... path) / startPlayer(String... videoToken) ### Description Launches a standalone activity with the player to play files from a URI or from Ziggeo servers via video token. ### Parameters - **path** (Uri...) - Optional - One or more paths to local files - **videoToken** (String...) - Optional - One or more video tokens for server-side playback ``` -------------------------------- ### Get an auth token Source: https://ziggeo.com/docs/sdks/server-side/php/auth-tokens Retrieves details for a specific auth token. ```php $ziggeo->authtokens()->get($token) ``` ```php authtokens()->get($opts["auth_token"]); var_dump($result); ?> ``` -------------------------------- ### ziggeo.videos().create Source: https://ziggeo.com/docs/sdks/server-side/csharp/videos Creates a new video. ```APIDOC ## ziggeo.videos().create ### Description Create a new video. ### Method SDK Method ### Signature `ziggeo.videos().create(Dictionary arguments, string file)` ### Parameters - **file** (string) - Required - Video file to be uploaded. - **min_duration** (string) - Optional - Minimal duration of video. - **max_duration** (string) - Optional - Maximal duration of video. - **tags** (string) - Optional - Video Tags. - **key** (string) - Optional - Unique name of video. - **volatile** (string) - Optional - Automatically removed this video if it remains empty. - **effect_profile** (string) - Optional - Set the effect profile to be applied. - **meta_profile** (string) - Optional - Set the meta profile to be applied. - **video_profile** (string) - Optional - Set the video profile to be applied. ``` -------------------------------- ### Get Auth Token Source: https://ziggeo.com/docs/sdks/server-side/java/auth-tokens Retrieves a single authentication token by its identifier. ```java ziggeo.authtokens().get(String token) ``` -------------------------------- ### Get an Auth Token Source: https://ziggeo.com/docs/sdks/server-side/csharp/auth-tokens Retrieves a single authentication token by its identifier. ```csharp ziggeo.authtokens().get(string token) ``` -------------------------------- ### Configure Extra Arguments Source: https://ziggeo.com/docs/sdks/mobile/android Examples of passing custom data, effect profiles, or video profiles to the recorder via extra arguments. ```java HashMap extraArguments = new HashMap<>(); extraArguments.put("data", "{\"key\":\"value\"}"); RecorderConfig config = new RecorderConfig.Builder() .maxDuration(5000) .extraArgs(extraArguments) .build(); ``` ```java HashMap extraArguments = new HashMap<>(); extraArguments.put("effect_profile", "1234567890"); RecorderConfig config = new RecorderConfig.Builder() .extraArgs(extraArguments) .build(); ``` ```java HashMap extraArguments = new HashMap<>(); extraArguments.put("video_profile", "1234567890"); RecorderConfig config = new RecorderConfig.Builder() .extraArgs(extraArguments) .build(); ``` -------------------------------- ### Initialize Audio Session Source: https://ziggeo.com/docs/sdks/mobile/swift Configure the AVAudioSession in the AppDelegate to support recording and playback. ```swift func application(_ application: UIApplication, didFinishLaunchingWithOptions ...) { // Override point for customization after application launch. do { try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, with: [AVAudioSessionCategoryOptions.duckOthers, AVAudioSessionCategoryOptions.defaultToSpeaker]); } catch {} return true } ``` -------------------------------- ### Get active element Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Returns the HTML reference to the embedding in the DOM. ```javascript embedding.activeElement(); ``` -------------------------------- ### Example stream response Source: https://ziggeo.com/docs/sdks/server-side/node/video-streams JSON response structure for a single stream. ```json { "volatile":false, "token":"d751140b4e1cf0a243f32092f6110296", "key":null, "creation_type":5, "state":5, "streamable":2, "video_type":"mp4", "video_sub_type":"other", "image_size":0, "video_size":36078, "video_width":640, "video_height":360, "duration":1, "has_video":true, "has_image":true, "submission_date":1390257799, "type":"ApiVideoStream", "created":1390257799, "owned":true, "creation_type_string":"SERVER_UPLOAD", "streamable_string":"DEGRADED", "state_string":"READY" } ``` -------------------------------- ### Initialize Player with Auth Token Source: https://ziggeo.com/docs/sdks/mobile/swift Create a player instance with additional client authorization parameters. ```swift ZiggeoPlayer.createPlayerWithAdditionalParams(application: m_ziggeo, videoToken: "VIDEO_TOKEN", params: ["client_auth":"CLIENT_AUTH_TOKEN"]) { (player:ZiggeoPlayer?) in DispatchQueue.main.async { let playerController: AVPlayerViewController = AVPlayerViewController(); playerController.player = player; self.present(playerController, animated: true, completion: nil); playerController.player?.play(); } } ``` -------------------------------- ### ZiggeoRecorder2 Initialization Source: https://ziggeo.com/docs/sdks/mobile/ios Initializes and presents the beta ZiggeoRecorder2, which supports simultaneous recording with 3rd party audio apps. ```APIDOC ## ZiggeoRecorder2 ### Description Initializes the beta ZiggeoRecorder2, allowing for video and audio recording without interrupting background playback. ### Code ```objectivec ZiggeoRecorder2* recorder = [[ZiggeoRecorder2 alloc] initWithZiggeoApplication:m_ziggeo]; [self presentViewController:recorder animated:true completion:nil]; ``` ``` -------------------------------- ### Basic face outline implementation Source: https://ziggeo.com/docs/how-tos/javascript/advanced-setup-of-face-outline Use the faceoutline parameter within the ziggeorecorder tag to enable the default face guide. ```html ``` -------------------------------- ### createVideoWithData:file:cover:callback:Progress: Source: https://ziggeo.com/docs/sdks/mobile/ios Creates a new video by uploading a file. ```APIDOC ## [videos createVideoWithData:nil file:videoPath cover:cover callback:callback Progress:progress]; ### Description Uploads a video file to the Ziggeo platform. Supports optional cover images and progress tracking. ### Parameters - **data** (NSDictionary) - Optional - Metadata for the video. - **file** (NSString) - Required - Path to the video file. - **cover** (UIImage) - Optional - Cover image for the video. - **callback** (Block) - Optional - Completion block receiving response data. - **Progress** (Block) - Optional - Progress block receiving bytes sent and total bytes. ``` -------------------------------- ### Initialize Ziggeo in Website Header Source: https://ziggeo.com/docs/sdks/javascript/browser-integration/header Include these tags in the section of your website to load the Ziggeo CSS and JavaScript, and initialize the application instance. ```html ``` -------------------------------- ### Upload video file Source: https://ziggeo.com/docs/sdks/javascript/browser-interaction/methods Starts the upload process for a video file. ```javascript embedding.upload_video(file); ```