### 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