NAV
JavaScript/JSON PHP XML ActionScript 3

Introduction

The Viddler API exposes key features to clients that would like to build custom solutions using Viddler’s multimedia platform. In order to use Viddler’s API you must have a Viddler account that has API access enabled, and an active API key. If you do not have API access and would like to upgrade your account, please contact our sales department either via email: solutions@viddler.com or via phone at 1-888-444-1119.

Responsible Use Guidelines

We ask that you keep in mind the following to allow for the best API experience for all of our users:

API Endpoint

For example, to call viddler.api.getInfo using a PHP response format and using HTTPS: https://api.viddler.com/api/v2/viddler.api.getInfo.php

Request Formats and Methods

The Viddler platform API uses the REST (simplified) method in most cases (HTTP request with all arguments passed as HTTP parameters) - GET - methods that don’t change anything (read-only data) - POST - methods that change underlying data model (create, change, or delete) - multipart POST - used for media uploads only. - SSL - supported for all API methods (and required for many)

(In general, methods with “get” in their name involve GET requests, and methods with “set”, “remove”, or “upload” are POST/Multipart POST.)

Methods

Naming Convention

Viddler’s API uses the format of [scope].[group].[action]

Common Parameters

Special Characters

When passing along special characters for parameters (usually as a part of a password) you should take care to urlencode the characters before sending them to the Viddler API.

Response Formats

Request: GET http://api.viddler.com/api/v2/viddler.api.getInfo.xml?key=API_KEY


Response:
Content-Type: text/xml;charset=UTF-8
X-Viddler-Node: api0
<viddler_api>
     <version>2.0.0</version>
</viddler_api>
Request: GET http://api.viddler.com/api/v2/viddler.api.getInfo.json?key=API_KEY
Response:
Content-Type: application/json;charset=UTF-8 X-Viddler-Node: api0
{  
   "viddler_api":{  
      "version":"2.0.0"
   }
}
jsonViddlerAPI(
   {
      "viddler_api":{
         "version":"2.0.0"
   }
}
)
Request: GET http://api.viddler.com/api/v2/viddler.api.getInfo.php?key=API_KEY

Response:
Content-Type: text/plain
 X-Viddler-Node: api0
 a:1:{
   s:11:"viddler_api";a:1:{ 
      s:7:"version";s:5:"2.0.0";
   } 
}

Viddler’s API v2 supports four response formats:

Content-type HTTP response changes according to the response format.

Paginated Responses

{
   "list_result": {
   "page": "1",
   "per_page": "1",
   "sort": "uploaded-desc",
   "featured_videos": [
 { ... } // This would contain the list items
]}}
jsonViddlerAPI (
    {
    "list_result":{
    "page":"1",
    "per_page":"10",
    "total":"25",
    "sort":"uploaded-desc",
    "video_list":[
    {...} // This would contain the list results
    ]}})
Array (
   [list_result] => Array (
   [page] => 1
   [per_page] => 1
   [sort] => uploaded-desc //sort tag is added on sort enabled methods
   [featured_videos] => Array //tag name depends on data it holds   ([0] => Array (
        ... // This would contain the list items
)
)))
<list_result>
<page>1</page>
<per_page>10</per_page>
<total>25</total>
<sort>uploaded-desc</sort>
<video_list>
...
</video_list>
</list_result>

Some methods include a paginated list of items. These methods use a unified response format in order to return list metadata in addition of pure list items. All paginated lists results will have a very similar, if not identical, schema. The list of results is listed in a nested array with a “tag” appropriate for its method. Sort tags are available for methods that allow for sorting.

“per_page” and Obtaining The Total Number of Pages

Most methods that return lists include per_page and page parameters. The maximum allowed value for the per_page parameter is 100.

While there is no upper limit for the page value, you can use the following information to obtain the total/maximum for a particular response:

total_count / per_page Round the result up to the nearest number. In PHP, for example, you can use the ceil() method.

Data Types

Authentication

When using the Viddler API, your API key is not the only method of authorizing what you are able to do. As the API was built with the ability to manipulate data from multiple accounts, we also utilize a session ID, which can be obtained using the viddler.users.auth method. The session ID ties an API method to your account, enabling read/write of private information (your account data, information on private videos, etc.)

Platform API EULA

BY OBTAINING AN API PRODUCT KEY FROM VIDDLER, YOU AGREE TO BE BOUND BY AND BECOME A PARTY TO THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, YOU MAY NOT OBTAIN AN API KEY AND VIDDLER DOES NOT GRANT YOU A LICENSE TO USE THE APIs.

Viddler reserves the right to update and change, from time to time, the terms of this Agreement by posting the amended terms on the Developers Site. Except as stated below, all amended terms shall be effective thirty (30) days after they are initially posted on the Developers Site. Use of the API after the date on which such changes become effective shall constitute your acceptance of such changes.

  1. GRANT OF API LICENSE – Subject to your (“Licensee’s”) full compliance with all of the terms and conditions of this API Agreement (“Agreement”), Viddler, Inc. (“Viddler”) grants Licensee a non-exclusive, revocable, non-sublicensable, non-transferable license to download and use the Viddler application program interface and other materials provided by Viddler (collectively, “APIs”) to develop, reproduce and distribute non-commercial applications that interoperate with Viddler.com or any other web property owned by Viddler. Licensee may not install or use the APIs for any other purpose, including without limit any commercial purpose, without Viddler’s prior written consent and execution of a Partner License Agreement. Requests for API keys intended for commercial use are reviewed by staff and a Partner License Agreement can be executed for commercial use.

Licensee shall not use the APIs in connection with or to promote any products, services, or materials that constitute, promote or are used primarily for the purpose of dealing in: spyware, adware, or other malicious programs or code, counterfeit goods, items subject to U.S. embargo, unsolicited mass distribution of email (“spam”), multi-level marketing proposals, hate materials, hacking/ surveillance /interception/ descrambling equipment, libelous, defamatory, obscene, pornographic, abusive or otherwise offensive content, prostitution, body parts and bodily fluids, stolen products and items used for theft, fireworks, explosives, and hazardous materials, government IDs, police items, gambling, professional services regulated by state licensing regimes, non-transferable items such as airline tickets or event tickets, weapons and accessories. .In the event Viddler establishes API call volume limitations and Licensee exceeds such limitations, Viddler may discontinue Licensee’s use of the API and/or charge Licensee at the then-current rates for all API calls that exceed the limitations.

  1. PROPRIETARY RIGHTS – As between Viddler and Licensee, the APIs and all intellectual property rights in and to the APIs are and shall at all times remain the sole and exclusive property of Viddler and are protected by applicable intellectual property laws and treaties.

  2. OTHER RESTRICTIONS – Except as expressly and unambiguously authorized under this Agreement, Licensee may not (i) copy, rent, lease, sell, transfer, assign, sublicense, disassemble, reverse engineer or decompile (except to the limited extent expressly authorized by applicable statutory law), modify or alter any part of the APIs, or (ii) otherwise use the APIs on behalf of any third party. This Agreement does not include any right for Licensee to use any trademark, service mark, trade name or any other mark of Viddler or any other party or licensor. No rights or licenses are granted except as expressly and unambiguously set forth herein. If Licensee violates any of the foregoing restrictions, Viddler shall own all right, title and interest relating to any and all inventions, works of authorship, designs, know-how, ideas and information made or conceived or reduced to practice, in while or in part, using the APIs. Licensee hereby agrees to make all assignments necessary to accomplish the foregoing ownership.

  3. WARRANTY DISCLAIMER – The APIs are provided “as is” without warranty of any kind. except to the extent required by applicable law, Viddler and its vendors each disclaim all warranties, whether express, implied or statutory, regarding the APIs, including without limitation any and all implied warranties of merchantability, accuracy, results of use, reliability, fitness for a particular purpose, title, interference with quiet enjoyment, and non-infringement of third-party rights. further, Viddler disclaims any warranty that licensee’s use of the apis will be uninterrupted or error free.

  4. SUPPORT AND UPGRADES – This Agreement does not entitle Licensee to any support for the APIs, unless Licensee makes separate arrangements with Viddler as part of a Partner License Agreement and pays all fees associated with such support. Any such support provided by Viddler shall be subject to the terms of this Agreement.

  5. LIABILITY LIMITATION – Regardless of whether any remedy set forth herein fails of its essential purpose or otherwise, and except for bodily injury, in no event will Viddler or its vendors, be liable to licensee or to any third party under any tort, contract, negligence, strict liability or other legal or equitable theory for any lost profits, lost or corrupted data, computer failure or malfunction, interruption of business, or other special, indirect, incidental or consequential damages of any kind arising out of the use or inability to use the apis, even if Viddler has been advised of the possibility of such loss or damages and whether or not such loss or damages are foreseeable. any claim arising out of or relating to this agreement must be brought within one (1) year after the occurrence of the event giving rise to such claim. in addition, Viddler disclaims all liability of any kind of Viddler’s vendors.

  6. INDEMNITY – Licensee agrees that Viddler shall have no liability whatsoever for any use Licensee makes of the APIs. Licensee shall indemnify and hold harmless Viddler from any and all claims, damages, liabilities, costs and fees (including reasonable attorneys’ fees) arising from Licensee’s use of the APIs.

  7. TERM AND TERMINATION – This Agreement shall continue until terminated as set forth in this Section. Either party may terminate this Agreement at any time, for any reason, or for no reason including, but not limited to, if Licensee violates any provision of this Agreement. Any termination of this Agreement shall also terminate the license granted hereunder. Upon termination of this Agreement for any reason, Licensee shall destroy and remove from all computers, hard drives, networks, and other storage media all copies of the APIs, and shall so certify to Viddler that such actions have occurred. Viddler shall have the right to inspect and audit Licensee’s facilities to confirm the foregoing. Sections 6 through 11 and all accrued rights to payment shall survive termination of this Agreement.

  8. MODIFICATION. – Viddler reserves the right to update and change, from time to time, the terms of this Agreement by posting the amended terms on the Developers Site. Except as stated herein, all amended terms shall be effective thirty (30) days after they are initially posted on the Developers Site. IF ANY MODIFICATION IS UNACCEPTABLE TO YOU, YOUR ONLY RECOURSE IS TO TERMINATE THIS AGREEMENT BY SENDING A TERMINATION NOTICE TO NETSUPPORT(at)VIDDLER(dot)COM BEFORE THE EFFECTIVE DATE OF THE AMENDMENT(S). THE AMENDMENT. TERMINATION NOTICE WILL BE EFFECTIVE ON THE DATE IT IS RECEIVED BY VIDDLER. THE MOST CURRENT VERSION OF THE AGREEMENT WILL BE AVAILABLE ON THE DEVELOPERS SITE AND WILL SUPERCEDE ALL PREVIOUS VERSIONS OF THE AGREEMENT. USE OF THE API AFTER THE DATE ON WHICH SUCH CHANGES BECOME EFFECTIVE SHALL CONSTITUTE YOUR ACCEPTANCE OF SUCH CHANGES.

  9. EXPORT CONTROLS – Licensee shall comply with all export laws and restrictions and regulations of the Department of Commerce, the United States Department of Treasury Office of Foreign Assets Control (“OFAC”), or other United States or foreign agency or authority, and Licensee shall not export, or allow the export or re-export of the APIs in violation of any such restrictions, laws or regulations. By downloading or using the APIs, Licensee agrees to the foregoing and represents and warrants that Licensee is not located in, under the control of, or a national or resident of any restricted country.

  10. MISCELLANEOUS – This Agreement constitutes the entire agreement between Licensee and Viddler pertaining to the subject matter hereof, and supersedes any and all written or oral agreements with respect to such subject matter. This Agreement, and any disputes arising from or relating to the interpretation thereof, shall be governed by and construed under Pennsylvania law as such law applies to agreements between Pennsylvania residents entered into and to be performed within Pennsylvania by two residents thereof and without reference to its conflict of laws principles or the United Nations Conventions for the International Sale of Goods. Except to the extent otherwise determined by Viddler, any action or proceeding arising from or relating to this Agreement must be brought in a federal court in Pennsylvania or in state court in Pennsylvania, and each party irrevocably submits to the jurisdiction and venue of any such court in any such action or proceeding. The prevailing party in any action arising out of this Agreement shall be entitled to an award of its costs and attorneys’ fees. This Agreement may be amended only by a writing executed by Viddler. If any provision of this Agreement is held to be unenforceable for any reason, such provision shall be reformed only to the extent necessary to make it enforceable. The failure of Viddler to act with respect to a breach of this Agreement by Licensee or others does not constitute a waiver and shall not limit Viddler’s rights with respect to such breach or any subsequent breaches. This Agreement is personal to Licensee and may not be assigned or transferred for any reason whatsoever (including, without limitation, by operation of law, merger, reorganization, or as a result of an acquisition or change of control involving Licensee) without Viddler’s prior written consent and any action or conduct in violation of the foregoing shall be void and without effect. Viddler expressly reserves the right to assign this Agreement and to delegate any of its obligations hereunder.

[[Category:API]] [[Category:Developers]]

Viddler Platform API v2

API Wrappers

Viddler has several wrappers available to use to make getting started with our data API easy! Usage Instructions for these wrappers are located on their respective pages.

Supported Wrappers

Unsupported, Third-party or Experimental Wrappers

viddler.users.auth

Method Type: GET

http://api.viddler.com/api/v2/.json?username=USERNAME&password=PASSWORD&get_record_token= 1&api_key=API_KEY
{
    "auth": {
    "sessionid": "3bc32dd14103fa0442544f4d4ba6",
    "record_token": "141536a14103fa0444544f4d4b25b" }
}

Authenticate an account. Returns a sessionid to be used with subsequent API methods. get_record_token set to 1 or true will provide a record token without needing to also call viddler.videos.getRecordToken.

Parameters

viddler.api.echo

http://api.viddler.com/api/v2/viddler.api.echo.json?message=Hello, world!&api_key=API_KEY
{
    "echo_response": {
    "message": "Hello, world!" }
}

Method Type: GET

Used for testing purposes only. It returns the message you provide as a way to make sure the API is responding.

Parameters

viddler.api.getInfo

http://api.viddler.com/api/v2/viddler.api.echo.json?message=Hello, world!&api_key=API_KEY
{
    "echo_response": {
    "message": "Hello, world!" }
}

Method Type: GET

Returns the current version of the Viddler v2 API

Parameters

viddler.encoding.cancel

http://api.viddler.com/api/v2/viddler.encoding.cancel.json?file_id=718a02524123d5d4752205be595a48af&api_key=API_KEY&sessionid=3a135a141e0a0da0c544f4d4bda

{
  "list_result": {
    "video_encoding_list": [
      {
        "created_at": "1382453299",
        "original_file_name": "Test Video.mov",
        "video": {
          "id": "cb946ae0",
          "status": "ready",
          "author": "tomk",
          "title": "Test Video",
          "upload_time": "1380454605",
          "made_public_time": "1380454605",
          "length": "10",
          "description": "",
          "age_limit": "",
          "url": "http://www.viddler.com/v/cb946ae0",
          "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_cb946ae0_v1.jpg",
          "thumbnail_version": "v1",
          "permalink": "http://www.viddler.com/v/cb946ae0",
          "html5_video_source": "http://www.viddler.com/file/cb946ae0/html5",
          "view_count": "0",
          "impression_count": "1",
          "favorite": "0",
          "comment_count": "0",
          "password_protection": "0",
          "thumbnails_count": "2",
          "thumbnail_index": "0",
          "permissions": {
            "view": {
              "level": "public"
            },
            "embed": {
              "level": "private"
            },
            "tagging": {
              "level": "private"
            },
            "commenting": {
              "level": "private"
            },
            "download": {
              "level": "private"
            }
          },
          "comments_moderation": {
            "level": "",
            "to_review": "0"
          },
          "display_aspect_ratio": "16:9"
        },
        "video_file_encoding_list": [
          {
            "id": "718a02524120dad82475b6e0bfae864b",
            "status": "ready",
            "ext": "webm",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "6",
            "profile_name": "WebM",
            "created_at": "1382453299",
            "status_update_at": "1382453316",
            "encoding_created_at": "1382453299",
            "encoding_last_updated_at": "1382453316",
            "encoding_started_at": "1382453301",
            "encoding_token": "u81e32d39bda7aafb79ab4ab9b91e8b8d1a8da1b2",
            "encoding_status": "success",
            "encoding_progress": "100",
            "encoding_queue_position": "0"
          }
        ]
      }
    ]
  }
}

Method Type: POST

Cancels the encoding of a specific video file.

Parameters

viddler.encoding.encode

http://api.viddler.com/api/v2/viddler.encoding.encode.json?video_id=cb946ae0&profile_id=6&api_key=API_KEY&sessionid=3a135a141e0a0da0c544f4d4bda

{
  "video_file_encoding": {
    "id": "718a02524120dad82475b6e0bfae864b",
    "status": "new",
    "ext": "webm",
    "source": "0",
    "flash": "na",
    "iphone": "na",
    "ipad": "na",
    "itunes": "na",
    "profile_id": "6",
    "profile_name": "WebM",
    "created_at": "1382453299",
    "status_update_at": "1382453299",
    "encoding_created_at": "",
    "encoding_last_updated_at": "",
    "encoding_started_at": "",
    "encoding_token": "u81e32d39bda7aafb79ab4ab9b91e8b8d1a8da1b2",
    "encoding_status": "new",
    "encoding_progress": "0",
    "encoding_queue_position": "0"
  }
}

Method Type: POST

Sends a request to re-encode a file.

Parameters

viddler.encoding.getSettings

http://api.viddler.com/api/v2/viddler.encoding.getSettings.json?api_key=API_KEY&sessionid=1833335141706d9698544f4d4b108
{
   "encoding_settings":{
      "use_source_for_playback":"1",
      "encoding_profiles":[
         {
            "id":"8",
            "name":"360p",
            "format":"mp4",
            "enabled":"1",
            "bitrate":"600",
            "allowed_bitrates":"200,400,600,800",
            "dimensions":"640x360"
         },
         {
            "id":"3",
            "name":"480p",
            "format":"mp4",
            "enabled":"1",
            "bitrate":"1000",
            "allowed_bitrates":"400,600,800,1000,1500",
            "dimensions":"854x480"
         },
         {
            "id":"4",
            "name":"720p",
            "format":"mp4",
            "enabled":"1",
            "bitrate":"2000",
            "allowed_bitrates":"800,1000,1500,2000,2500",
            "dimensions":"1280x720"
         },
         {
            "id":"7",
            "name":"1080p",
            "format":"mp4",
            "enabled":"1",
            "bitrate":"3000",
            "allowed_bitrates":"1500,2000,2500,3000,4000,5000",
            "dimensions":"1920x1080"
         },
         {
            "id":"5",
            "name":"3GP",
            "format":"3gp",
            "enabled":"1",
            "bitrate":"100",
            "allowed_bitrates":"50,100,200,500",
            "dimensions":"320x180"
         },
         {
            "id":"6",
            "name":"WebM",
            "format":"webm",
            "enabled":"1",
            "bitrate":"800",
            "allowed_bitrates":"400,600,800,1000",
            "dimensions":"854x480"
         }
      ]
   }
}

Method Type: GET

Returns the encoding settings (formats, bit rates, and dimensions) for an account (determined by the sessionid)

Parameters

viddler.encoding.getStatus2

http://api.viddler.com/api/v2/viddler.encoding.getStatus2.json?api_key=API_KEY&sessionid=1d232ef141705212ca544f4d4b34

{
   "list_result":{
      "video_encoding_list":[
         {
            "created_at":"1380454605",
            "original_file_name":"Test Video.mov",
            "video":{
               "id":"cb946ae0",
               "status":"ready",
               "author":"tomk",
               "title":"Test Video",
               "upload_time":"1380454605",
               "made_public_time":"1380454605",
               "length":"10",
               "description":" ",
               "age_limit":"",
               "url":"http://www.viddler.com/v/cb946ae0",
               "thumbnail_url":"http://thumbs.cdn-ec.viddler.com/thumbnail_2_cb946ae0_v1.jpg",
               "thumbnail_version":"v1",
               "permalink":"http://www.viddler.com/v/cb946ae0",
               "html5_video_source":"http://www.viddler.com/file/cb946ae0/html5",
               "view_count":"0",
               "impression_count":"0",
               "favorite":"0",
               "comment_count":"0",
               "password_protection":"0",
               "thumbnails_count":"2",
               "thumbnail_index":"0",
               "permissions":{
                  "view":{
                     "level":"public"
                  },
                  "embed":{
                     "level":"private"
                  },
                  "tagging":{
                     "level":"private"
                  },
                  "commenting":{
                     "level":"private"
                  },
                  "download":{
                     "level":"private"
                  }
               },
               "comments_moderation":{
                  "level":"",
                  "to_review":"0"
               },
               "display_aspect_ratio":"16:9"
            },
            "video_file_encoding_list":[
               {
                  "id":"71850c5e4824d5d47cea8807cf267bc7",
                  "status":"ready",
                  "ext":"mp4",
                  "source":"0",
                  "flash":"on",
                  "iphone":"on",
                  "ipad":"on",
                  "itunes":"on",
                  "profile_id":"3",
                  "profile_name":"480p",
                  "created_at":"1380454605",
                  "status_update_at":"1380454625",
                  "encoding_created_at":"1380454605",
                  "encoding_last_updated_at":"1380454625",
                  "encoding_started_at":"1380454610",
                  "encoding_token":"e5a4dbcbfd6a7a4a0779d8d793a9297d2927dbde5_3",
                  "encoding_status":"success",
                  "encoding_progress":"100",
                  "encoding_queue_position":"0"
               },
               {
                  "id":"71850c5e4824d4dc68f11992021ea893",
                  "status":"ready",
                  "ext":"3gp",
                  "source":"0",
                  "flash":"na",
                  "iphone":"na",
                  "ipad":"na",
                  "itunes":"na",
                  "profile_id":"5",
                  "profile_name":"3GP",
                  "created_at":"1380454605",
                  "status_update_at":"1380454911",
                  "encoding_created_at":"1380454605",
                  "encoding_last_updated_at":"1380454911",
                  "encoding_started_at":"1380454897",
                  "encoding_token":"e5a4dbcbfd6a7a4a0779d8d793a9297d2927dbde5_5",
                  "encoding_status":"success",
                  "encoding_progress":"100",
                  "encoding_queue_position":"0"
               },
               {
                  "id":"71850c5e4824d4de9de2d305cee4b804",
                  "status":"ready",
                  "ext":"webm",
                  "source":"0",
                  "flash":"na",
                  "iphone":"na",
                  "ipad":"na",
                  "itunes":"na",
                  "profile_id":"6",
                  "profile_name":"WebM",
                  "created_at":"1380454605",
                  "status_update_at":"1380454934",
                  "encoding_created_at":"1380454605",
                  "encoding_last_updated_at":"1380454934",
                  "encoding_started_at":"1380454919",
                  "encoding_token":"e5a4dbcbfd6a7a4a0779d8d793a9297d2927dbde5_6",
                  "encoding_status":"success",
                  "encoding_progress":"100",
                  "encoding_queue_position":"0"
               },
               {
                  "id":"71850c5e4824d5da0bac9064d16f5a40",
                  "status":"ready",
                  "ext":"mp4",
                  "source":"0",
                  "flash":"on",
                  "iphone":"on",
                  "ipad":"on",
                  "itunes":"on",
                  "profile_id":"8",
                  "profile_name":"360p",
                  "created_at":"1380454605",
                  "status_update_at":"1380454911",
                  "encoding_created_at":"1380454605",
                  "encoding_last_updated_at":"1380454911",
                  "encoding_started_at":"1380454896",
                  "encoding_token":"e5a4dbcbfd6a7a4a0779d8d793a9297d2927dbde5_8",
                  "encoding_status":"success",
                  "encoding_progress":"100",
                  "encoding_queue_position":"0"
               }
            ]
         }
      ]
   }
}

Method Type: GET

Obtains encoding status. Send along a video\_id to get status for all the files for that particular video only. This is an enhancement of our original, now deprecated, viddler.encoding.getStatus method.

Parameters

viddler.playlists.addVideo

http://api.viddler.com/api/v2/viddler.playlists.addVideo.json?playlist_id=70850d524612e0ef&video_id=51271da7&api_key=API_KEY&sessionid=2c7320e141514c7b8d544f4d4b197

{
  "list_result": {
    "page": "1",
    "per_page": "10",
    "sort": "idx-asc",
    "playlist": {
      "id": "70850d524612e0ef",
      "name": "Test",
      "type": "regular",
      "visibility": "private",
      "user": "tomk"
    },
    "video_list": [
      {
        "id": "51271da7",
        "status": "ready",
        "author": "tomk",
        "title": "Test Video",
        "upload_time": "1378828001",
        "made_public_time": "1378828001",
        "length": "10",
        "description": "",
        "age_limit": "",
        "url": "http://www.viddler.com/v/51271da7",
        "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_51271da7_v1.jpg",
        "thumbnail_version": "v1",
        "permalink": "http://www.example.com/video1.html",
        "html5_video_source": "http://www.viddler.com/file/51271da7/html5",
        "view_count": "0",
        "impression_count": "1",
        "favorite": "0",
        "comment_count": "0",
        "password_protection": "0",
        "thumbnails_count": "2",
        "thumbnail_index": "0",
        "permissions": {
          "view": {
            "level": "public"
          },
          "embed": {
            "level": "private"
          },
          "tagging": {
            "level": "private"
          },
          "commenting": {
            "level": "private"
          },
          "download": {
            "level": "private"
          }
        },
        "comments_moderation": {
          "level": "",
          "to_review": "0"
        },
        "display_aspect_ratio": "16:9",
        "files": [
          {
            "id": "718500584129d2dc13ef4e82e421fe26",
            "status": "ready",
            "ext": "mov",
            "type": "video/quicktime",
            "width": "960",
            "height": "540",
            "size": "5418416",
            "url": "http://www.viddler.com/file/d/51271da7.mov?vfid=718500584129d2dc13ef4e82e421fe26",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "1",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "on",
            "profile_id": "",
            "profile_name": "Source",
            "created_at": "1378828001",
            "status_update_at": "1378828001"
          },
          {
            "id": "718500584129d2de555b3aa81c1385f0",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "640",
            "height": "360",
            "size": "739348",
            "url": "http://www.viddler.com/file/d/51271da7.mp4?vfid=718500584129d2de555b3aa81c1385f0",
            "html5_video_source": "http://www.viddler.com/file/51271da7/718500584129d2de555b3aa81c1385f0",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "8",
            "profile_name": "360p",
            "created_at": "1378828001",
            "status_update_at": "1378828020"
          },
          {
            "id": "718500584129d2d8918da548aeeeb07f",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "854",
            "height": "480",
            "size": "1255544",
            "url": "http://www.viddler.com/file/d/51271da7.mp4?vfid=718500584129d2d8918da548aeeeb07f",
            "html5_video_source": "http://www.viddler.com/file/51271da7/718500584129d2d8918da548aeeeb07f",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "3",
            "profile_name": "480p",
            "created_at": "1378828001",
            "status_update_at": "1378828035"
          },
          {
            "id": "718500584129d2da3e0c15f625af4626",
            "status": "ready",
            "ext": "3gp",
            "type": "video/3gpp",
            "width": "320",
            "height": "180",
            "size": "119298",
            "url": "http://www.viddler.com/file/d/51271da7.3gp?vfid=718500584129d2da3e0c15f625af4626",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "5",
            "profile_name": "3GP",
            "created_at": "1378828001",
            "status_update_at": "1378828022"
          },
          {
            "id": "718500584129d2d4cd734f31eb65ef40",
            "status": "deleted",
            "ext": "webm",
            "type": "video/webm",
            "width": "854",
            "height": "480",
            "size": "564195",
            "url": "",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "6",
            "profile_name": "WebM",
            "created_at": "1378828001",
            "status_update_at": "1378828092"
          }
        ],
        "closed_captioning_list": [
          {
            "id": "7a82065c7515e7e8",
            "enabled": "1",
            "language": "en",
            "type": "SRT",
            "file_size": "144",
            "file_url": "http://ccs.cdn-ec.viddler.com/51271da7_1a83ff8b88fe023d5d81f612c82f89ed67757520.srt",
            "default": "1"
          }
        ]
      }
    ]
  }
}

Method Type: POST

Adds a video to a regular playlist. The same video can be added multiple times to a single playlist if you choose.

Parameters

viddler.playlists.create

http://api.viddler.com/api/v2/viddler.playlists.addVideo.json?playlist_id=70850d524612e0ef&video_id=51271da7&api_key=API_KEY&sessionid=2c7320e141514c7b8d544f4d4b197

{
  "list_result": {
    "page": "1",
    "per_page": "10",
    "sort": "idx-asc",
    "playlist": {
      "id": "70850d524612e0ef",
      "name": "Test",
      "type": "regular",
      "visibility": "private",
      "user": "tomk"
    },
    "video_list": [
      {
        "id": "51271da7",
        "status": "ready",
        "author": "tomk",
        "title": "Test Video",
        "upload_time": "1378828001",
        "made_public_time": "1378828001",
        "length": "10",
        "description": "",
        "age_limit": "",
        "url": "http://www.viddler.com/v/51271da7",
        "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_51271da7_v1.jpg",
        "thumbnail_version": "v1",
        "permalink": "http://www.example.com/video1.html",
        "html5_video_source": "http://www.viddler.com/file/51271da7/html5",
        "view_count": "0",
        "impression_count": "1",
        "favorite": "0",
        "comment_count": "0",
        "password_protection": "0",
        "thumbnails_count": "2",
        "thumbnail_index": "0",
        "permissions": {
          "view": {
            "level": "public"
          },
          "embed": {
            "level": "private"
          },
          "tagging": {
            "level": "private"
          },
          "commenting": {
            "level": "private"
          },
          "download": {
            "level": "private"
          }
        },
        "comments_moderation": {
          "level": "",
          "to_review": "0"
        },
        "display_aspect_ratio": "16:9",
        "files": [
          {
            "id": "718500584129d2dc13ef4e82e421fe26",
            "status": "ready",
            "ext": "mov",
            "type": "video/quicktime",
            "width": "960",
            "height": "540",
            "size": "5418416",
            "url": "http://www.viddler.com/file/d/51271da7.mov?vfid=718500584129d2dc13ef4e82e421fe26",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "1",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "on",
            "profile_id": "",
            "profile_name": "Source",
            "created_at": "1378828001",
            "status_update_at": "1378828001"
          },
          {
            "id": "718500584129d2de555b3aa81c1385f0",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "640",
            "height": "360",
            "size": "739348",
            "url": "http://www.viddler.com/file/d/51271da7.mp4?vfid=718500584129d2de555b3aa81c1385f0",
            "html5_video_source": "http://www.viddler.com/file/51271da7/718500584129d2de555b3aa81c1385f0",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "8",
            "profile_name": "360p",
            "created_at": "1378828001",
            "status_update_at": "1378828020"
          },
          {
            "id": "718500584129d2d8918da548aeeeb07f",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "854",
            "height": "480",
            "size": "1255544",
            "url": "http://www.viddler.com/file/d/51271da7.mp4?vfid=718500584129d2d8918da548aeeeb07f",
            "html5_video_source": "http://www.viddler.com/file/51271da7/718500584129d2d8918da548aeeeb07f",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "3",
            "profile_name": "480p",
            "created_at": "1378828001",
            "status_update_at": "1378828035"
          },
          {
            "id": "718500584129d2da3e0c15f625af4626",
            "status": "ready",
            "ext": "3gp",
            "type": "video/3gpp",
            "width": "320",
            "height": "180",
            "size": "119298",
            "url": "http://www.viddler.com/file/d/51271da7.3gp?vfid=718500584129d2da3e0c15f625af4626",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "5",
            "profile_name": "3GP",
            "created_at": "1378828001",
            "status_update_at": "1378828022"
          },
          {
            "id": "718500584129d2d4cd734f31eb65ef40",
            "status": "deleted",
            "ext": "webm",
            "type": "video/webm",
            "width": "854",
            "height": "480",
            "size": "564195",
            "url": "",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "6",
            "profile_name": "WebM",
            "created_at": "1378828001",
            "status_update_at": "1378828092"
          }
        ],
        "closed_captioning_list": [
          {
            "id": "7a82065c7515e7e8",
            "enabled": "1",
            "language": "en",
            "type": "SRT",
            "file_size": "144",
            "file_url": "http://ccs.cdn-ec.viddler.com/51271da7_1a83ff8b88fe023d5d81f612c82f89ed67757520.srt",
            "default": "1"
          }
        ]
      }
    ]
  }
}

Method Type: POST

Adds a video to a regular playlist. The same video can be added multiple times to a single playlist if you choose.

Parameters

viddler.playlists.delete

Method Type: POST

Deletes a Playlist

Parameters

viddler.playlists.getbyUser

Method Type: GET

http://api.viddler.com/api/v2/viddler.playlists.getByUser.json?user=tomk&api_key=API_KEY&sessionid=1be31d41414bfe2237544f4d4b3ca

{  
  "list_result": {
    "page": "1",
    "per_page": "10",
    "playlists": [
      {
        "id": "70850d524612e0ef",
        "name": "Test",
        "type": "regular",
        "visibility": "private",
        "user": "tomk"
      },
      {
        "id": "728301594729e1ee",
        "name": "Test",
        "type": "smart",
        "visibility": "public",
        "user": "tomk",
        "rules": {
          "users": "tomk",
          "tags": "Test Tag",
          "visibility": "public"
        }
      }
    ]
  }
}

Lists all of the playlists for an account (Only public playlists unless the sessionid is for the user specified.)

Parameters

viddler.playlists.getDetails

http://api.viddler.com/api/v2/viddler.playlists.getDetails.json?playlist_id=70850d524612e0ef&api_key=API_KEY&sessionid=16e32341414c03f71e544f4d4b342

{
  "list_result": {
    "page": "1",
    "per_page": "10",
    "sort": "idx-asc",
    "playlist": {
      "id": "70850d524612e0ef",
      "name": "Test",
      "type": "regular",
      "visibility": "private",
      "user": "tomk"
    },
    "video_list": [
      {
        "id": "b8f60f03",
        "status": "ready",
        "author": "tomk",
        "title": "Big Buck Bunny",
        "upload_time": "1310058958",
        "made_public_time": "1310651695",
        "length": "597",
        "description": "Testing ",
        "age_limit": "",
        "url": "http://www.viddler.com/v/b8f60f03",
        "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_b8f60f03_v10.jpg",
        "thumbnail_version": "v10",
        "permalink": "http://www.viddler.com/v/b8f60f03",
        "html5_video_source": "http://www.viddler.com/file/b8f60f03/html5",
        "view_count": "220",
        "impression_count": "693",
        "favorite": "0",
        "comment_count": "1",
        "password_protection": "0",
        "thumbnails_count": "11",
        "thumbnail_index": "0",
        "permissions": {
          "view": {
            "level": "public"
          },
          "embed": {
            "level": "public"
          },
          "tagging": {
            "level": "public"
          },
          "commenting": {
            "level": "public"
          },
          "download": {
            "level": "public"
          }
        },
        "comments_moderation": {
          "level": "",
          "to_review": "0"
        },
        "display_aspect_ratio": "16:9",
        "files": [
          {
            "id": "7181065a4125d0df48461357696a041b",
            "status": "ready",
            "ext": "m4v",
            "type": "video/x-m4v",
            "width": "1280",
            "height": "720",
            "size": "184891418",
            "url": "http://www.viddler.com/file/d/b8f60f03.m4v?vfid=7181065a4125d0df48461357696a041b",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "1",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "on",
            "profile_id": "",
            "profile_name": "Source",
            "created_at": "1364842359",
            "status_update_at": "1364842359"
          },
          {
            "id": "7181065a4125d0dbb77b06234b77a929",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "640",
            "height": "360",
            "size": "52633817",
            "url": "http://www.viddler.com/file/d/b8f60f03.mp4?vfid=7181065a4125d0dbb77b06234b77a929",
            "html5_video_source": "http://www.viddler.com/file/b8f60f03/7181065a4125d0dbb77b06234b77a929",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "8",
            "profile_name": "360p",
            "created_at": "1364842359",
            "status_update_at": "1364842843"
          },
          {
            "id": "7181065a4125d0d5394ebfbda532d32b",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "854",
            "height": "480",
            "size": "70688524",
            "url": "http://www.viddler.com/file/d/b8f60f03.mp4?vfid=7181065a4125d0d5394ebfbda532d32b",
            "html5_video_source": "http://www.viddler.com/file/b8f60f03/7181065a4125d0d5394ebfbda532d32b",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "3",
            "profile_name": "480p",
            "created_at": "1364842359",
            "status_update_at": "1364842558"
          },
          {
            "id": "7181065a4125d7dd22aba2d1407ae5c3",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "1280",
            "height": "720",
            "size": "127142697",
            "url": "http://www.viddler.com/file/d/b8f60f03.mp4?vfid=7181065a4125d7dd22aba2d1407ae5c3",
            "html5_video_source": "http://www.viddler.com/file/b8f60f03/7181065a4125d7dd22aba2d1407ae5c3",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "na",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "4",
            "profile_name": "720p",
            "created_at": "1364842359",
            "status_update_at": "1364843195"
          },
          {
            "id": "7181065a4125d7df6adc10afe22b3c22",
            "status": "ready",
            "ext": "3gp",
            "type": "video/3gpp",
            "width": "320",
            "height": "180",
            "size": "11332181",
            "url": "http://www.viddler.com/file/d/b8f60f03.3gp?vfid=7181065a4125d7df6adc10afe22b3c22",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "5",
            "profile_name": "3GP",
            "created_at": "1364842359",
            "status_update_at": "1364842843"
          },
          {
            "id": "7181065a4125d7d9efcb774edd0a58e7",
            "status": "ready",
            "ext": "webm",
            "type": "video/webm",
            "width": "854",
            "height": "480",
            "size": "42131630",
            "url": "http://www.viddler.com/file/d/b8f60f03.webm?vfid=7181065a4125d7d9efcb774edd0a58e7",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "6",
            "profile_name": "WebM",
            "created_at": "1364842359",
            "status_update_at": "1364843157"
          }
        ],
        "closed_captioning_list": [

        ]
      }
    ]
  }
}

Method Type: GET

Obtains details of a given playlist, which includes type, status, and the videos within. Videos listed in playlist similar to the response from viddler.videos.getDetails

Parameters

viddler.playlists.list

http://api.viddler.com/api/v2/viddler.playlists.list.json?api_key=API_KEY&sessionid=1be31d41414bfe2237544f4d4b3ca

{  
  "list_result": {
    "page": "1",
    "per_page": "10",
    "playlists": [
      {
        "id": "70850d524612e0ef",
        "name": "Test",
        "type": "regular",
        "visibility": "private",
        "user": "tomk"
      },
      {
        "id": "728301594729e1ee",
        "name": "Test",
        "type": "smart",
        "visibility": "public",
        "user": "tomk",
        "rules": {
          "users": "tomk",
          "tags": "Test Tag",
          "visibility": "public"
        }
      }
    ]
  }
}

Method Type: GET

Lists all of the playlists for the account (determined by the sessionid)

Parameters

viddler.playlists.moveVideo

Method Type: GET

Moves a video from one position to another in a regular playlist.

Parameters

viddler.playlists.removeVideo

Method Type: GET

Removes a video in a regular playlist.

Parameters

viddler.playlists.setDetails

http://api.viddler.com/api/v2/viddler.playlists.setDetails.json?name=API List&video_ids=51271da7&api_key=API_KEY&sessionid=3c831aa1413c95ddce544f4d4b17a

{
  "list_result": {
    "page": "1",
    "per_page": "10",
    "sort": "idx-asc",
    "playlist": {
      "id": "7281045a4723e1ee",
      "name": "API List",
      "type": "regular",
      "visibility": "private",
      "user": "tomk"
    },
    "video_list": [
      {
        "id": "51271da7",
        "status": "ready",
        "author": "tomk",
        "title": "Test Video",
        "upload_time": "1378828001",
        "made_public_time": "1378828001",
        "length": "10",
        "description": " ",
        "age_limit": "",
        "url": "http://www.viddler.com/v/51271da7",
        "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_51271da7_v1.jpg",
        "thumbnail_version": "v1",
        "permalink": "http://www.example.com/video1.html",
        "html5_video_source": "http://www.viddler.com/file/51271da7/html5",
        "view_count": "0",
        "impression_count": "1",
        "favorite": "0",
        "comment_count": "0",
        "password_protection": "0",
        "thumbnails_count": "2",
        "thumbnail_index": "0",
        "permissions": {
          "view": {
            "level": "public"
          },
          "embed": {
            "level": "private"
          },
          "tagging": {
            "level": "private"
          },
          "commenting": {
            "level": "private"
          },
          "download": {
            "level": "private"
          }
        },
        "comments_moderation": {
          "level": "",
          "to_review": "0"
        },
        "display_aspect_ratio": "16:9",
        "files": [
          {
            "id": "718500584129d2dc13ef4e82e421fe26",
            "status": "ready",
            "ext": "mov",
            "type": "video/quicktime",
            "width": "960",
            "height": "540",
            "size": "5418416",
            "url": "http://www.viddler.com/file/d/51271da7.mov?vfid=718500584129d2dc13ef4e82e421fe26",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "1",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "on",
            "profile_id": "",
            "profile_name": "Source",
            "created_at": "1378828001",
            "status_update_at": "1378828001"
          },
          {
            "id": "718500584129d2de555b3aa81c1385f0",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "640",
            "height": "360",
            "size": "739348",
            "url": "http://www.viddler.com/file/d/51271da7.mp4?vfid=718500584129d2de555b3aa81c1385f0",
            "html5_video_source": "http://www.viddler.com/file/51271da7/718500584129d2de555b3aa81c1385f0",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "8",
            "profile_name": "360p",
            "created_at": "1378828001",
            "status_update_at": "1378828020"
          }
        ],
        "closed_captioning_list": [
          {
            "id": "7a82065c7515e7e8",
            "enabled": "1",
            "language": "en",
            "type": "SRT",
            "file_size": "144",
            "file_url": "http://ccs.cdn-ec.viddler.com/51271da7_1a83ff8b88fe023d5d81f612c82f89ed67757520.srt",
            "default": "1"
          }
        ]
      }
    ]
  }
}

Method Type: POST

Updates playlist details. This method is similar to viddler.playlists.create, though it cannot alter the playlist type. (This cannot be changed after the playlist is created)

Parameters

type=regular Parameters

type=smart Parameters

viddler.videos.getDetails

http://api.viddler.com/api/v2/viddler.videos.getDetails.json?video_id=881e2fbd

{
  "video": {
    "id": "881e2fbd",
    "status": "ready",
    "author": "tomk",
    "title": "Comment Permission Example - DO NOT DELETE",
    "upload_time": "1376501992",
    "made_public_time": "1376501992",
    "length": "100",
    "description": "",
    "age_limit": "",
    "url": "http://www.viddler.com/v/881e2fbd",
    "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_881e2fbd_v2.jpg",
    "thumbnail_version": "v2",
    "permalink": "http://www.viddler.com/v/881e2fbd",
    "html5_video_source": "http://www.viddler.com/file/881e2fbd/html5",
    "view_count": "4",
    "impression_count": "77",
    "favorite": "0",
    "comment_count": "7",
    "tags": [
      {
        "type": "global",
        "text": "comment permissions"
      },
      {
        "type": "global",
        "text": "do not delete"
      },
      {
        "type": "global",
        "text": "example"
      }
    ],
    "password_protection": "0",
    "thumbnails_count": "12",
    "thumbnail_index": "11",
    "permissions": {
      "view": {
        "level": "public"
      },
      "embed": {
        "level": "private"
      },
      "tagging": {
        "level": "public"
      },
      "commenting": {
        "level": "public"
      },
      "download": {
        "level": "private"
      }
    },
    "comments_moderation": {
      "level": "",
      "to_review": "0"
    },
    "display_aspect_ratio": "16:9",
    "files": [
      {
        "id": "7184025e4622d3d90adc3a3c5c0cd66a",
        "status": "ready",
        "ext": "mov",
        "type": "video/quicktime",
        "width": "1280",
        "height": "720",
        "size": "44881749",
        "url": "http://www.viddler.com/file/d/881e2fbd.mov?vfid=7184025e4622d3d90adc3a3c5c0cd66a",
        "html5_video_source": "",
        "display_aspect_ratio": "16:9",
        "source": "1",
        "flash": "na",
        "iphone": "na",
        "ipad": "na",
        "itunes": "on",
        "profile_id": "",
        "profile_name": "Source",
        "created_at": "1376501992",
        "status_update_at": "1376501992"
      },
      {
        "id": "7184025e4622d3d5f0b5507c3049b4b9",
        "status": "ready",
        "ext": "mp4",
        "type": "video/mp4",
        "width": "640",
        "height": "360",
        "size": "8924094",
        "url": "http://www.viddler.com/file/d/881e2fbd.mp4?vfid=7184025e4622d3d5f0b5507c3049b4b9",
        "html5_video_source": "http://www.viddler.com/file/881e2fbd/7184025e4622d3d5f0b5507c3049b4b9",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "on",
        "iphone": "on",
        "ipad": "on",
        "itunes": "on",
        "profile_id": "8",
        "profile_name": "360p",
        "created_at": "1376501992",
        "status_update_at": "1376502102"
      },
      {
        "id": "7184025e4622d2dd9accb619662c1b2a",
        "status": "ready",
        "ext": "mp4",
        "type": "video/mp4",
        "width": "854",
        "height": "480",
        "size": "14801249",
        "url": "http://www.viddler.com/file/d/881e2fbd.mp4?vfid=7184025e4622d2dd9accb619662c1b2a",
        "html5_video_source": "http://www.viddler.com/file/881e2fbd/7184025e4622d2dd9accb619662c1b2a",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "on",
        "iphone": "on",
        "ipad": "on",
        "itunes": "on",
        "profile_id": "3",
        "profile_name": "480p",
        "created_at": "1376501992",
        "status_update_at": "1376502057"
      },
      {
        "id": "7184025e4622d2df5f1dcb048051feda",
        "status": "ready",
        "ext": "mp4",
        "type": "video/mp4",
        "width": "1280",
        "height": "720",
        "size": "29447712",
        "url": "http://www.viddler.com/file/d/881e2fbd.mp4?vfid=7184025e4622d2df5f1dcb048051feda",
        "html5_video_source": "http://www.viddler.com/file/881e2fbd/7184025e4622d2df5f1dcb048051feda",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "on",
        "iphone": "na",
        "ipad": "on",
        "itunes": "on",
        "profile_id": "4",
        "profile_name": "720p",
        "created_at": "1376501992",
        "status_update_at": "1376502154"
      },
      {
        "id": "7184025e4622d2d9126bc6f009dac20c",
        "status": "ready",
        "ext": "3gp",
        "type": "video/3gpp",
        "width": "320",
        "height": "180",
        "size": "1960419",
        "url": "http://www.viddler.com/file/d/881e2fbd.3gp?vfid=7184025e4622d2d9126bc6f009dac20c",
        "html5_video_source": "",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "na",
        "iphone": "na",
        "ipad": "na",
        "itunes": "na",
        "profile_id": "5",
        "profile_name": "3GP",
        "created_at": "1376501992",
        "status_update_at": "1376502117"
      },
      {
        "id": "7184025e4622d2db5429f832134964dc",
        "status": "ready",
        "ext": "webm",
        "type": "video/webm",
        "width": "854",
        "height": "480",
        "size": "11279197",
        "url": "http://www.viddler.com/file/d/881e2fbd.webm?vfid=7184025e4622d2db5429f832134964dc",
        "html5_video_source": "",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "na",
        "iphone": "na",
        "ipad": "na",
        "itunes": "na",
        "profile_id": "6",
        "profile_name": "WebM",
        "created_at": "1376501992",
        "status_update_at": "1376502163"
      }
    ],
    "closed_captioning_list": [

    ]
  }
}

Method Type: GET

Returns a full lists of details for a particular video, including a list of individual files.

Deleted files will be shown in the response until the files are purged. Please note that there is no “HD” property for video files – This is determined by a file’s profile and/or its dimensions (1280x720 or higher)

Parameters

viddler.videos.setDetails

http://api.viddler.com/api/v2/viddler.videos.setDetails.json?video_id=b8f60f03&tags="testtest tag",tag2&view_perm=public&api_key=API_KEY&sessionid=2113ef14107e2abdc544f4d4b392


{
  "video": {
    "id": "b8f60f03",
    "status": "ready",
    "author": "tomk",
    "title": "Big Buck Bunny",
    "upload_time": "1310058958",
    "made_public_time": "1310651695",
    "length": "597",
    "description": "Testing ",
    "age_limit": "",
    "url": "http://www.viddler.com/v/b8f60f03",
    "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_b8f60f03_v6.jpg",
    "thumbnail_version": "v6",
    "permalink": "http://thomas.kover.me/test/playertesting2.html",
    "html5_video_source": "http://www.viddler.com/file/b8f60f03/html5",
    "view_count": "220",
    "impression_count": "693",
    "favorite": "0",
    "comment_count": "1",
    "tags": [
      {
        "type": "global",
        "text": "tag2"
      },
      {
        "type": "global",
        "text": "testtest tag"
      }
    ],
    "password_protection": "0",
    "thumbnails_count": "11",
    "thumbnail_index": "2",
    "permissions": {
      "view": {
        "level": "public"
      },
      "embed": {
        "level": "public"
      },
      "tagging": {
        "level": "public"
      },
      "commenting": {
        "level": "public"
      },
      "download": {
        "level": "public"
      }
    },
    "comments_moderation": {
      "level": "",
      "to_review": "0"
    },
    "display_aspect_ratio": "16:9",
    "files": [

{
        "id": "7181065a4125d0df48461357696a041b",
        "status": "ready",
        "ext": "m4v",
        "type": "video/x-m4v",
        "width": "1280",
        "height": "720",
        "size": "184891418",
        "url": "http://www.viddler.com/file/d/b8f60f03.m4v?vfid=7181065a4125d0df48461357696a041b",
        "html5_video_source": "",
        "display_aspect_ratio": "16:9",
        "source": "1",
        "flash": "na",
        "iphone": "na",
        "ipad": "na",
        "itunes": "on",
        "profile_id": "",
        "profile_name": "Source",
        "created_at": "1364842359",
        "status_update_at": "1364842359"
      },
      {
        "id": "7181065a4125d0dbb77b06234b77a929",
        "status": "ready",
        "ext": "mp4",
        "type": "video/mp4",
        "width": "640",
        "height": "360",
        "size": "52633817",
        "url": "http://www.viddler.com/file/d/b8f60f03.mp4?vfid=7181065a4125d0dbb77b06234b77a929",
        "html5_video_source": "http://www.viddler.com/file/b8f60f03/7181065a4125d0dbb77b06234b77a929",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "on",
        "iphone": "on",
        "ipad": "on",
        "itunes": "on",
        "profile_id": "8",
        "profile_name": "360p",
        "created_at": "1364842359",
        "status_update_at": "1364842843"
      },
      {
        "id": "7181065a4125d0d5394ebfbda532d32b",
        "status": "ready",
        "ext": "mp4",
        "type": "video/mp4",
        "width": "854",
        "height": "480",
        "size": "70688524",
        "url": "http://www.viddler.com/file/d/b8f60f03.mp4?vfid=7181065a4125d0d5394ebfbda532d32b",
        "html5_video_source": "http://www.viddler.com/file/b8f60f03/7181065a4125d0d5394ebfbda532d32b",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "on",
        "iphone": "on",
        "ipad": "on",
        "itunes": "on",
        "profile_id": "3",
        "profile_name": "480p",
        "created_at": "1364842359",
        "status_update_at": "1364842558"
      },
      {
        "id": "7181065a4125d7dd22aba2d1407ae5c3",
        "status": "ready",
        "ext": "mp4",
        "type": "video/mp4",
        "width": "1280",
        "height": "720",
        "size": "127142697",
        "url": "http://www.viddler.com/file/d/b8f60f03.mp4?vfid=7181065a4125d7dd22aba2d1407ae5c3",
        "html5_video_source": "http://www.viddler.com/file/b8f60f03/7181065a4125d7dd22aba2d1407ae5c3",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "on",
        "iphone": "na",
        "ipad": "on",
        "itunes": "on",
        "profile_id": "4",
        "profile_name": "720p",
        "created_at": "1364842359",
        "status_update_at": "1364843195"
      },
      {
        "id": "7181065a4125d7df6adc10afe22b3c22",
        "status": "ready",
        "ext": "3gp",
        "type": "video/3gpp",
        "width": "320",
        "height": "180",
        "size": "11332181",
        "url": "http://www.viddler.com/file/d/b8f60f03.3gp?vfid=7181065a4125d7df6adc10afe22b3c22",
        "html5_video_source": "",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "na",
        "iphone": "na",
        "ipad": "na",
        "itunes": "na",
        "profile_id": "5",
        "profile_name": "3GP",
        "created_at": "1364842359",
        "status_update_at": "1364842843"
      },
      {
        "id": "7181065a4125d7d9efcb774edd0a58e7",
        "status": "ready",
        "ext": "webm",
        "type": "video/webm",
        "width": "854",
        "height": "480",
        "size": "42131630",
        "url": "http://www.viddler.com/file/d/b8f60f03.webm?vfid=7181065a4125d7d9efcb774edd0a58e7",
        "html5_video_source": "",
        "display_aspect_ratio": "16:9",
        "source": "0",
        "flash": "na",
        "iphone": "na",
        "ipad": "na",
        "itunes": "na",
        "profile_id": "6",
        "profile_name": "WebM",
        "created_at": "1364842359",
        "status_update_at": "1364843157"
      }
    ],
    "closed_captioning_list": [

    ]
  }
}

Method Type: POST

Update parameters for a particular video.

Parameters

Response is the same as viddler.videos.getDetails

viddler.videos.addClosedCaptioning

Method Type: POST

Add a closed captioning (subtitle) file to a video. Important: This method does not accept a MULTIPART POST file upload; the file must be hosted at another publicly accessible URL.

Filetypes accepted: .srt

Parameters

viddler.videos.setClosedCaptioning

Method Type: POST

Update closed captioning details. closed_captioning_id can be obtained from viddler.videos.getDetails.

Parameters

viddler.videos.delClosedCaptioning

Method Type: POST

Deleted a closed captioning (subtitle) file. closed_captioning_id can be obtained from viddler.videos.getDetails.

Parameters

viddler.videos.comments.get

http://api.viddler.com/api/v2/viddler.videos.comments.get.json?video_id=51271da7&api_key=API_KEY&sessionid=1be322d1415623fe4a544f4d4b121
{
   "list_result":{
      "page":"1",
      "per_page":"10",
      "sort":"date-desc",
      "comments_list":[
         {
            "id":"72860c5d4220d5ed",
            "type":"text",
            "author":"tomk",
            "rating":"0",
            "replies_count":"2",
            "text":"Test Comment! ",
            "add_time":"1380121818",
            "add_timepoint":"5000",
            "comments_moderation":{
               "status":"1",
               "obscenity_filter":""
            }
         }
      ]
   }
}

Method Type: GET

Get comments for the specified video. If this video is owned by the sessionid: All comments with any moderation status are returned If this video is not owned by the sessionid: Only comments that are approved are returned, and only if the video is set to Public.

Parameters

viddler.videos.comments.add

http://api.viddler.com/api/v2/viddler.videos.comments.add.json?video_id=51271da7&text=Hello World!&timepoint=7&api_key=API_KEY&sessionid=19831741416f715a21544f4d4b1ec

{
  "video": {
    "id": "51271da7",
    "status": "ready",
    "author": "tomk",
    "title": "Test Video",
    "upload_time": "1378828001",
    "made_public_time": "1378828001",
    "length": "10",
    "description": "",
    "age_limit": "",
    "url": "http://www.viddler.com/v/51271da7",
    "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_51271da7_v1.jpg",
    "thumbnail_version": "v1",
    "permalink": "http://www.example.com/video1.html",
    "html5_video_source": "http://www.viddler.com/file/51271da7/html5",
    "view_count": "0",
    "impression_count": "1",
    "favorite": "0",
    "comment_count": "4",
    "comments": [
      {
        "id": "72860d5e4122d7ed",
        "type": "text",
        "author": "tomk",
        "rating": "0",
        "replies_count": "0",
        "text": "Hello World!",
        "add_time": "1380554403",
        "add_timepoint": "7000",
        "comments_moderation": {
          "status": "1",
          "obscenity_filter": "hell"
        }
      },
      {
        "id": "72860d5e4122d1ed",
        "type": "text",
        "author": "tomk",
        "rating": "0",
        "replies_count": "0",
        "text": "Hello World!",
        "add_time": "1380554399",
        "comments_moderation": {
          "status": "1",
          "obscenity_filter": "hell"
        }
      }
    ],
    "password_protection": "0",
    "thumbnails_count": "2",
    "thumbnail_index": "0",
    "permissions": {
      "view": {
        "level": "public"
      },
      "embed": {
        "level": "private"
      },
      "tagging": {
        "level": "private"
      },
      "commenting": {
        "level": "private"
      },
      "download": {
        "level": "private"
      }
    },
    "comments_moderation": {
      "level": "",
      "to_review": "0"
    },
    "display_aspect_ratio": "16:9"
  }
}

Method Type: POST

Adds a comment to a video, either in a general thread (as shown below the video on viddler.com or the arpeggio comments widget) or a timed comment (as shown inside the player).

Parameters

viddler.videos.comments.delete

http://api.viddler.com/api/v2/viddler.videos.comments.delete.json?comment_id=72860d5e4122d7ed&api_key=API_KEY&sessionid=368316c1416f7a58fc544f4d4b13b


{
  "video": {
    "id": "51271da7",
    "status": "ready",
    "author": "tomk",
    "title": "Test Video",
    "upload_time": "1378828001",
    "made_public_time": "1378828001",
    "length": "10",
    "description": "",
    "age_limit": "",
    "url": "http://www.viddler.com/v/51271da7",
    "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_51271da7_v1.jpg",
    "thumbnail_version": "v1",
    "permalink": "http://www.example.com/video1.html",
    "html5_video_source": "http://www.viddler.com/file/51271da7/html5",
    "view_count": "0",
    "impression_count": "1",
    "favorite": "0",
    "comment_count": "3",
    "comments": [
      {
        "id": "72860d5e4122d1ed",
        "type": "text",
        "author": "tomk",
        "rating": "0",
        "replies_count": "0",
        "text": "Hello World!",
        "add_time": "1380554399",
        "comments_moderation": {
          "status": "1",
          "obscenity_filter": "hell"
        }
      }
    ],
    "password_protection": "0",
    "thumbnails_count": "2",
    "thumbnail_index": "0",
    "permissions": {
      "view": {
        "level": "public"
      },
      "embed": {
        "level": "private"
      },
      "tagging": {
        "level": "private"
      },
      "commenting": {
        "level": "private"
      },
      "download": {
        "level": "private"
      }
    },
    "comments_moderation": {
      "level": "",
      "to_review": "0"
    },
    "display_aspect_ratio": "16:9"
  }
}

Method Type: POST

Removes a comment.

Important: This cannot be undone.

Parameters

viddler.videos.delete

http://api.viddler.com/api/v2/viddler.videos.delete.json?video_id=e5ba8159&api_key=API_KEY&sessionid=2cf37a141085f4a74544f4d4b361

{
  "success": {
  }
}

Method Type: POST

Deletes a video.

Parameters

viddler.videos.delFile

http://api.viddler.com/api/v2/viddler.videos.delFile.json?file_id=718500584129d2d4cd734f31eb65ef40&api_key=API_KEY&sessionid=ce314c141088e5276544f4d4b391

{
  "video": {
    "id": "51271da7",
    "status": "ready",
    "author": "tomk",
    "title": "Test Video",
    "upload_time": "1378828001",
    "made_public_time": "1378828001"
  }
}

Method Type: POST

Deletes a specific video file (just the 3GP version, for example) for a particular video. The file_id parameter can be found from viddler.videos.getDetails

Parameters

viddler.videos.deleteQueue.add

http://api.viddler.com/v2/viddler.videos.deleteQueue.add.json?dry_run=false&min_upload_date=2010-01-01&max_upload_date=2014-12-12

Method Type: GET

Adds video to a “deletion queue” - This is particularly useful for scripting and mass cleanup of your video content. By default, the dry_run parameter is set to true by default to allow for non-destructive testing.

Parameters

viddler.videos.deleteQueue.get

http://api.viddler.com/v2/viddler.videos.deleteQueue.get
{
  "delete_rules": {
    "id: 1": [
      {
        "status": "CANCEL",
        "description": "API_DELETE_SHALLOW",
        "ip": "127.0.0.1",
        "rules": {
          "min_upload_date": "2010-01-01",
          "max_upload_date": "2014-11-01"
        }
      }
    ],
    "id: 3": [
      {
        "status": "CANCEL",
        "description": "API_DELETE_SHALLOW",
        "ip": "127.0.0.1",
        "rules": {
          "min_upload_date": "2010-01-01",
          "max_upload_date": "2014-11-01"
        }
      }
    ],
    "id: 4": [
      {
        "status": "DONE",
        "description": "API_DELETE_SHALLOW",
        "ip": "127.0.0.1",
        "rules": {
          "min_upload_date": "2010-01-01",
          "max_upload_date": "2014-12-12"
        }
      }
    ],
    "id: 8": [
      {
        "status": "DONE",
        "description": "API_DELETE_SHALLOW",
        "ip": "127.0.0.1",
        "rules": {
          "min_upload_date": "2010-01-01",
          "max_upload_date": "2014-12-12"
        }
      }
    ],
    "id: 11": [
      {
        "status": "DONE",
        "description": "API_DELETE_SHALLOW",
        "ip": "127.0.0.1",
        "rules": {
          "min_upload_date": "2010-01-01",
          "max_upload_date": "2014-12-12"
        }
      }
    ]
  }
}

Method Type: GET

Adds video to a “deletion queue” - This is particularly useful for scripting and mass cleanup of your video content. By default, the dry_run parameter is set to true by default to allow for non-destructive testing.

Parameters

(none)

viddler.videos.getByTag

http://api.viddler.com/api/v2/viddler.videos.getByTag.json?tag=test&api_key=API_KEY&sessionid=a733e31413ba55d91544f4d4b396

{
  "list_result": {
    "page": "1",
    "per_page": "10",
    "total": "2",
    "sort": "uploaded-desc",
    "video_list": [
      {
        "id": "47ca099e",
        "status": "ready",
        "author": "tomk",
        "title": "Test Title",
        "upload_time": "1337914972",
        "made_public_time": "1337914972",
        "length": "95",
        "description": "Testing using a textarea for the description. should be fun! ",
        "age_limit": "",
        "url": "http://www.viddler.com/v/47ca099e",
        "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_47ca099e_v1.jpg",
        "thumbnail_version": "v1",
        "permalink": "http://www.viddler.com/v/47ca099e",
        "html5_video_source": "http://www.viddler.com/file/47ca099e/html5",
        "view_count": "3",
        "impression_count": "4",
        "favorite": "0",
        "comment_count": "0",
        "tags": [
          {
            "type": "global",
            "text": "newform"
          },
          {
            "type": "global",
            "text": "giddy"
          },
          {
            "type": "global",
            "text": "test"
          }
        ],
        "password_protection": "0",
        "thumbnails_count": "11",
        "thumbnail_index": "0",
        "permissions": {
          "view": {
            "level": "public"
          },
          "embed": {
            "level": "private"
          },
          "tagging": {
            "level": "private"
          },
          "commenting": {
            "level": "private"
          },
          "download": {
            "level": "private"
          }
        },
        "comments_moderation": {
          "level": "",
          "to_review": "0"
        },
        "display_aspect_ratio": "4:3"
      }, 
    ]
  }
}

Method Type: GET

Returns a list of videos that have the specified tag(s)

Parameters

viddler.videos.getByUser

http://api.viddler.com/api/v2/viddler.videos.getByUser.json?user=tomk&api_key=API_KEY&sessionid=218313814113c00d0a544f4d4b317


{
  "list_result": {
    "page": "1",
    "per_page": "10",
    "total": "1",
    "sort": "uploaded-desc",
    "video_list": [
      {
        "id": "e6b889fb",
        "status": "ready",
        "author": "tomk",
        "title": "tomk 09 10, 2013 Recorded video",
        "upload_time": "1378833005",
        "made_public_time": "1378833005",
        "length": "6",
        "description": " ",
        "age_limit": "",
        "url": "http://www.viddler.com/v/e6b889fb",
        "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_e6b889fb_v1.jpg",
        "thumbnail_version": "v1",
        "permalink": "http://www.viddler.com/v/e6b889fb",
        "html5_video_source": "http://www.viddler.com/file/e6b889fb/html5",
        "view_count": "0",
        "impression_count": "0",
        "favorite": "0",
        "comment_count": "0",
        "password_protection": "0",
        "thumbnails_count": "1",
        "thumbnail_index": "0",
        "permissions": {
          "view": {
            "level": "public"
          },
          "embed": {
            "level": "private"
          },
          "tagging": {
            "level": "private"
          },
          "commenting": {
            "level": "private"
          },
          "download": {
            "level": "private"
          }
        },
        "comments_moderation": {
          "level": "",
          "to_review": "0"
        },
        "display_aspect_ratio": "4:3",
        "files": [
          {
            "id": "718500584328d2d83c162bed7218ecfc",
            "status": "ready",
            "ext": "flv",
            "type": "video/x-flv",
            "width": "545",
            "height": "408",
            "size": "687313",
            "url": "http://www.viddler.com/file/d/e6b889fb.flv?vfid=718500584328d2d83c162bed7218ecfc",
            "html5_video_source": "",
            "display_aspect_ratio": "4:3",
            "source": "1",
            "flash": "on",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "",
            "profile_name": "Source",
            "created_at": "1378833005",
            "status_update_at": "1378833005"
          },
          {
            "id": "718500584328d2d4aa3008ff31c4d965",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "480",
            "height": "360",
            "size": "389758",
            "url": "http://www.viddler.com/file/d/e6b889fb.mp4?vfid=718500584328d2d4aa3008ff31c4d965",
            "html5_video_source": "http://www.viddler.com/file/e6b889fb/718500584328d2d4aa3008ff31c4d965",
            "display_aspect_ratio": "4:3",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "8",
            "profile_name": "360p",
            "created_at": "1378833005",
            "status_update_at": "1378833021"
          },
          {
            "id": "718500584328d1dcf6f6c175c8866ca4",
            "status": "ready",
            "ext": "3gp",
            "type": "video/3gpp",
            "width": "240",
            "height": "180",
            "size": "81854",
            "url": "http://www.viddler.com/file/d/e6b889fb.3gp?vfid=718500584328d1dcf6f6c175c8866ca4",
            "html5_video_source": "",
            "display_aspect_ratio": "4:3",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "5",
            "profile_name": "3GP",
            "created_at": "1378833005",
            "status_update_at": "1378833032"
          },
          {
            "id": "718500584328d1de49f1ac84ab3e83cf",
            "status": "ready",
            "ext": "webm",
            "type": "video/webm",
            "width": "544",
            "height": "408",
            "size": "434046",
            "url": "http://www.viddler.com/file/d/e6b889fb.webm?vfid=718500584328d1de49f1ac84ab3e83cf",
            "html5_video_source": "",
            "display_aspect_ratio": "4:3",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "6",
            "profile_name": "WebM",
            "created_at": "1378833005",
            "status_update_at": "1378833032"
          }
        ],
        "closed_captioning_list": [

        ]
      }

    ]
  }
}

Method Type: GET

Returns a list of videos for a particular account. Will only return Public videos for accounts not owned by the authenticated account.

Parameters

http://api.viddler.com/api/v2/viddler.videos.search.json?type=yourvideos&query=test&api_key=API_KEY&sessionid=8135c1410e780e96544f4d4b3e6


  "list_result": {
    "page": "1",
    "per_page": "10",
    "video_list": [
      {
        "id": "47ca099e",
        "status": "ready",
        "author": "tomk",
        "title": "Test Title",
        "upload_time": "1337914972",
        "made_public_time": "1337914972",
        "length": "95",
        "description": "Testing using a textarea for the description.",
        "age_limit": "",
        "url": "http://www.viddler.com/v/47ca099e",
        "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_47ca099e_v1.jpg",
        "thumbnail_version": "v1",
        "permalink": "http://www.viddler.com/v/47ca099e",
        "html5_video_source": "http://www.viddler.com/file/47ca099e/html5",
        "view_count": "3",
        "impression_count": "4",
        "favorite": "0",
        "comment_count": "0",
        "password_protection": "0",
        "thumbnails_count": "11",
        "thumbnail_index": "0",
        "permissions": {
          "view": {
            "level": "public"
          },
          "embed": {
            "level": "private"
          },
          "tagging": {
            "level": "private"
          },
          "commenting": {
            "level": "private"
          },
          "download": {
            "level": "private"
          }
        },
        "comments_moderation": {
          "level": "",
          "to_review": "0"
        },
        "display_aspect_ratio": "4:3",
        "files": [
          {
            "id": "7287075b4122dad450331041413f8983",
            "status": "ready",
            "ext": "mkv",
            "type": "application/octet-stream",
            "width": "624",
            "height": "480",
            "size": "22446963",
            "url": "http://www.viddler.com/file/d/47ca099e.mkv?vfid=7287075b4122dad450331041413f8983",
            "html5_video_source": "",
            "display_aspect_ratio": "4:3",
            "source": "1",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "",
            "profile_name": "Source",
            "created_at": "1337914972",
            "status_update_at": "1337914972"
          },
          {
            "id": "7287075b4125d3dc922de2d031e4dc52",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "624",
            "height": "480",
            "size": "11303042",
            "url": "http://www.viddler.com/file/d/47ca099e.mp4?vfid=7287075b4125d3dc922de2d031e4dc52",
            "html5_video_source": "http://www.viddler.com/file/47ca099e/7287075b4125d3dc922de2d031e4dc52",
            "display_aspect_ratio": "4:3",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "3",
            "profile_name": "480p",
            "created_at": "1337914972",
            "status_update_at": "1337915035"
          },
          {
            "id": "7287075b4125d3de9b798a1ae7d57bcd",
            "status": "ready",
            "ext": "3gp",
            "type": "video/3gpp",
            "width": "234",
            "height": "180",
            "size": "2972911",
            "url": "http://www.viddler.com/file/d/47ca099e.3gp?vfid=7287075b4125d3de9b798a1ae7d57bcd",
            "html5_video_source": "",
            "display_aspect_ratio": "4:3",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "5",
            "profile_name": "3GP",
            "created_at": "1337914972",
            "status_update_at": "1337915105"
          },
          {
            "id": "7287075b4125d3d80fefb504be48c7b1",
            "status": "ready",
            "ext": "webm",
            "type": "video/webm",
            "width": "624",
            "height": "480",
            "size": "9110242",
            "url": "http://www.viddler.com/file/d/47ca099e.webm?vfid=7287075b4125d3d80fefb504be48c7b1",
            "html5_video_source": "",
            "display_aspect_ratio": "4:3",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "6",
            "profile_name": "WebM",
            "created_at": "1337914972",
            "status_update_at": "1337915358"
          }
        ],
        "closed_captioning_list": [

        ]
      },
      {
        "id": "51271da7",
        "status": "ready",
        "author": "tomk",
        "title": "Test Video",
        "upload_time": "1378828001",
        "made_public_time": "1378828001",
        "length": "10",
        "description": " ",
        "age_limit": "",
        "url": "http://www.viddler.com/v/51271da7",
        "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_51271da7_v1.jpg",
        "thumbnail_version": "v1",
        "permalink": "http://www.example.com/video1.html",
        "html5_video_source": "http://www.viddler.com/file/51271da7/html5",
        "view_count": "0",
        "impression_count": "0",
        "favorite": "0",
        "comment_count": "0",
        "password_protection": "0",
        "thumbnails_count": "2",
        "thumbnail_index": "0",
        "permissions": {
          "view": {
            "level": "public"
          },
          "embed": {
            "level": "private"
          },
          "tagging": {
            "level": "private"
          },
          "commenting": {
            "level": "private"
          },
          "download": {
            "level": "private"
          }
        },
        "comments_moderation": {
          "level": "",
          "to_review": "0"
        },
        "display_aspect_ratio": "16:9",
        "files": [
          {
            "id": "718500584129d2dc13ef4e82e421fe26",
            "status": "ready",
            "ext": "mov",
            "type": "video/quicktime",
            "width": "960",
            "height": "540",
            "size": "5418416",
            "url": "http://www.viddler.com/file/d/51271da7.mov?vfid=718500584129d2dc13ef4e82e421fe26",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "1",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "on",
            "profile_id": "",
            "profile_name": "Source",
            "created_at": "1378828001",
            "status_update_at": "1378828001"
          },
          {
            "id": "718500584129d2de555b3aa81c1385f0",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "640",
            "height": "360",
            "size": "739348",
            "url": "http://www.viddler.com/file/d/51271da7.mp4?vfid=718500584129d2de555b3aa81c1385f0",
            "html5_video_source": "http://www.viddler.com/file/51271da7/718500584129d2de555b3aa81c1385f0",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "8",
            "profile_name": "360p",
            "created_at": "1378828001",
            "status_update_at": "1378828020"
          },
          {
            "id": "718500584129d2d8918da548aeeeb07f",
            "status": "ready",
            "ext": "mp4",
            "type": "video/mp4",
            "width": "854",
            "height": "480",
            "size": "1255544",
            "url": "http://www.viddler.com/file/d/51271da7.mp4?vfid=718500584129d2d8918da548aeeeb07f",
            "html5_video_source": "http://www.viddler.com/file/51271da7/718500584129d2d8918da548aeeeb07f",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "on",
            "iphone": "on",
            "ipad": "on",
            "itunes": "on",
            "profile_id": "3",
            "profile_name": "480p",
            "created_at": "1378828001",
            "status_update_at": "1378828035"
          },
          {
            "id": "718500584129d2da3e0c15f625af4626",
            "status": "ready",
            "ext": "3gp",
            "type": "video/3gpp",
            "width": "320",
            "height": "180",
            "size": "119298",
            "url": "http://www.viddler.com/file/d/51271da7.3gp?vfid=718500584129d2da3e0c15f625af4626",
            "html5_video_source": "",
            "display_aspect_ratio": "16:9",
            "source": "0",
            "flash": "na",
            "iphone": "na",
            "ipad": "na",
            "itunes": "na",
            "profile_id": "5",
            "profile_name": "3GP",
            "created_at": "1378828001",
            "status_update_at": "1378828022"
          },
        ],
        "closed_captioning_list": [
          {
            "id": "7a82065c7515e7e8",
            "enabled": "1",
            "language": "en",
            "type": "SRT",
            "file_size": "144",
            "file_url": "http://ccs.cdn-ec.viddler.com/51271da7_1a83ff8b88fe023d5d81f612c82f89ed67757520.srt",
            "default": "1"
          }
        ]
      }
    ]
  }
}

Method Type: GET

Search for videos based on various parameters. There are three different ways to search, distinguished by the type parameter. Parameters in the “Common” section can be used with any type. After selecting a type, follow only the parameter list for that type.

Parameters

type=yourvideos Parameters

type=user Parameters

type=allvideos Parameters

viddler.videos.getEmbedCodeTypes

http://api.viddler.com/api/v2/viddler.videos.getEmbedCodeTypes.json?api_key=API_KEY&sessionid=ce314c141088e5276544f4d4b391

{
  "list_result": {
    "default": "5",
    "embed_code_types": [
      {
        "id": "1",
        "name": "Legacy"
      },
      {
        "id": "2",
        "name": "Wordpress.com"
      },
      {
        "id": "3",
        "name": "Flash w/HTML5 fallback"
      },
      {
        "id": "5",
        "name": "iframe"
      }
    ]
  }
}

Method Type: GET

Returns a list of the embed code types available to the account. Used with viddler.videos.getEmbedCode

Parameters

viddler.videos.getEmbedCode

http://api.viddler.com/api/v2/viddler.videos.getEmbedCode.json?video_id=51271da7&width=500&player_type=mini&wmode=transparent&embed_code_type=5&hd=1&hidablecontrolbar=1&api_key=API_KEY&sessionid=320323b141089dff48544f4d4b260

{
  "video": {
    "video_id": "51271da7",
    "embed_code": "<iframe id=\"viddler-51271da7\" src=\"http://www.viddler.com/embed/51271da7?f=1&player=mini&secret=64215889&wmode=transparent&api_key=API_KEY&hd=1&hidablecontrolbar=1\" width=\"500\" height=\"281\" frameborder=\"0\" mozallowfullscreen=\"true\" webkitallowfullscreen=\"true\"></iframe>"
  }
}

Method Type: GET

Generate an Embed code for a particular video. Any supported parameter that you can use in our embed codes can be added in the format key=value (Ex: hd=1 or branding=1)

Parameters

viddler.videos.prepareUpload

http://api.viddler.com/api/v2/viddler.videos.prepareUpload.json?api_key=API_KEY&sessionid=1b831ce1416f7cf479544f4d4b3de

{
  "upload": {
    "endpoint": "http://uploads0.viddler.com/viddler_upload/upload/uploadvideo.json",
    "token": "u494ba4b45b423357629fdd25f2bd7e25417fc090"
  }
}

Method Type: GET

Provides a unique upload token and the endpoint for an individual upload session.

Parameters

viddler.videos.setSettings

http://api.viddler.com/api/v2/viddler.encoding.setSettings.json?api_key=API_KEY&profile_8_bitrate=800&sessionid=1833335141706d9698544f4d4b108
{
   "encoding_settings":{
      "use_source_for_playback":"1",
      "encoding_profiles":[
         {
            "id":"8",
            "name":"360p",
            "format":"mp4",
            "enabled":"1",
            "bitrate":"800",
            "allowed_bitrates":"200,400,600,800",
            "dimensions":"640x360"
         },
         {
            "id":"3",
            "name":"480p",
            "format":"mp4",
            "enabled":"1",
            "bitrate":"1000",
            "allowed_bitrates":"400,600,800,1000,1500",
            "dimensions":"854x480"
         },
         {
            "id":"4",
            "name":"720p",
            "format":"mp4",
            "enabled":"1",
            "bitrate":"2000",
            "allowed_bitrates":"800,1000,1500,2000,2500",
            "dimensions":"1280x720"
         },
         {
            "id":"7",
            "name":"1080p",
            "format":"mp4",
            "enabled":"1",
            "bitrate":"3000",
            "allowed_bitrates":"1500,2000,2500,3000,4000,5000",
            "dimensions":"1920x1080"
         },
         {
            "id":"5",
            "name":"3GP",
            "format":"3gp",
            "enabled":"1",
            "bitrate":"100",
            "allowed_bitrates":"50,100,200,500",
            "dimensions":"320x180"
         },
         {
            "id":"6",
            "name":"WebM",
            "format":"webm",
            "enabled":"1",
            "bitrate":"800",
            "allowed_bitrates":"400,600,800,1000",
            "dimensions":"854x480"
         }
      ]
   }
}

Method Type: POST

Sets encoding settings for an account, determined by the sessionid.

Parameters

viddler.videos.setThumbnail

http://api.viddler.com/api/v2/viddler.videos.setThumbnail.json?video_id=b8f60f03&timepoint=3&api_key=API_KEY&sessionid=493175141083d5f3f544f4d4b3e5

{
  "video": {
    "id": "b8f60f03",
    "status": "ready",
    "author": "tomk",
    "title": "Big Buck Bunny",
    "upload_time": "1310058958",
    "made_public_time": "1310651695",
    "length": "597",
    "description": "Testing ",
    "age_limit": "",
    "url": "http://www.viddler.com/v/b8f60f03",
    "thumbnail_url": "http://thumbs.cdn-ec.viddler.com/thumbnail_2_b8f60f03_v10.jpg",
    "thumbnail_version": "v10",
    "permalink": "http://thomas.kover.me/test/playertesting2.html",
    "html5_video_source": "http://www.viddler.com/file/b8f60f03/html5",
    "view_count": "220",
    "impression_count": "693",
    "favorite": "0",
    "comment_count": "1",
    "password_protection": "0",
    "thumbnails_count": "11",
    "thumbnail_index": "0",
    "permissions": {
      "view": {
        "level": "public"
      },
      "embed": {
        "level": "public"
      },
      "tagging": {
        "level": "public"
      },
      "commenting": {
        "level": "public"
      },
      "download": {
        "level": "public"
      }
    },
    "comments_moderation": {
      "level": "",
      "to_review": "0"
    },
    "display_aspect_ratio": "16:9"
  }
}

Method Type: POST (MULTIPART POST when uploading a thumbnail file)

Sets the video thumbnail. The thumbnail can be set to a time point (snapped to closest video keyframe) or a thumbnail file can be uploaded.

Parameters

Method call must contain only one of the following

API Errors

<error>
    <code>4</code>
    <description>missing required parameter</description> <details>message</details>
</error>
{"error":{ 
    "code":"4",
    "description":"missing required parameter",
    "details":"message" 
}}

a:1:{
    s:5:"error";a:3:{
        s:4:"code";s:1:"4";
        s:11:"description";s:26:"missing required parameter";
         s:7:"details";s:7:"message";
    } 
}

If you make a call to our API, it should return something every time. In the event something isn’t correct (missing parameters, media ownership, etc) the Viddler API will return an error.

Each API method response should be checked for the following to ensure it does not contain errors:

Error Codes

Error Description Cause Resolution
1 An internal error has occurred A Bug in the API Contact Us
2 Bad argument format The proper information for a parameter wasn’t provided (Ex. Sending an API Key as sessionid) Check spelling, and make sure the proper data is being sent
3 Unknown argument specified A parameter sent is unknown, and can’t be handled Check spelling, or check the documentation for this method.
4 Missing required argument for this method A parameter that is required an was not specified Check spelling, or check the documentation for this method.
5 No method specified The request did not include a method Include a method.
6 Unknown method specified The method provided is not valid Check spelling, review the documentation.
7 API key missing No API key parameter (&key=API\_KEY) was provided Include the API Key.
8 Invalid or unknown API key specified The API key is not valid Make sure the full API key is included.
9 Invalid or expired sessionid The sessionid has expired or does not exist Check to make sure additional characters aren’t being included.
10 Used HTTP method is not allowed for this API method Using GET when POST is required or vice-versa. Try using HTTP POST instead of HTTP GET, refer to the method documentation.
11 Method call not allowed The API Key is not able to utilize the method that was tried. If you require this method and receive this error, contact us.
12 API key disabled The API key is deactivated. Usually the result of breaking our TOS or other misuse of the service. Contact us to discuss restoring the API key.
13 Invalid data sent with request The data sent with the request is not valid (Ex: Sending a .zip instead of a video file) Check spelling, and make sure the proper data is being sent
14 Bad or invalid SSL State
15 Invalid response format requested The response format requested is not supported Choose a format the API supports: JSON, PHP, XML
100 Whatever you requested was Not Found. A resource that was requested does not exist Check spelling, and make sure the proper data is being sent, an a supported method is being called.
101 The action is forbidden Attempted action is not allowed based on the API Key provided Contact us or choose another method.
102 The account has been suspended The account being used has been suspended Contact Us for more information
103 Invalid password The provided password is incorrect Check spelling, urlencode your password if it has special characters
104 Terms not Accepted The Terms of Services (TOS) were not agreed to when creating an account Agree to the Terms of Service on account signup.
105 Username already exists The username provided is already taken) Try another username.
200 The provided file is too large The file that was provided exceeds the maximum limit for this method Upload a smaller file.
202 Upload Error Invalid multipart format request Submit the upload form as multipart/form-data
203 Uploading has been disabled This will appear during system maintenance periods. Wait and try again later.

Arpeggio Player (v2)

Browser Compatibility

As an HTML5 Player, functionality can differ between browsers and versions. Please keep in mind that while we try to maintain compatibility whenever possible, we target browser support in line with Google’s browser support policy.

Below is a general list of what you can expect to work on a given set of browsers

Browser Player Load/Playback Media Playback Method Timed Commenting VAST Tag
Internet Explorer 9 (Win) Partial HTML5 (MP4) No Yes
Internet Explorer 10 (Win) Yes HTML5 (MP4) Yes Yes
Internet Explorer 11 (Win) Yes HTML5 (MP4) Yes Yes
Google Chrome (38+) (Win / OS X / Linux ) Yes HTML5 (MP4) Yes Yes
Firefox (34+) (Mac) Yes HTML5 (MP4)* Yes Yes
Firefox (34+) (Win) Yes HTML5 (MP4)* Yes Yes
Safari (7+) (OS X) Yes HTML5 (MP4) Yes Yes
Mobile Safari (iOS 7+) Yes (iPhone uses native player controls) HTML5 (MP4) No No
Mobile Chrome (38+) Yes HTML5 (MP4) Yes No

* With compatible H.264 Decoder Installed

VAST Tag Support

<script type="text/javascript" src="//static.cdn-ec.viddler.com/js/arpeggio/v2/build/main-built.js"></script>

<div class="viddler-auto-embed" data-video-id="d3f8c4ac" data-width="437" data-vast-urls="http://ad3.liverail.com/?LR_PUBLISHER_ID={LR_ID}&LR_CAMPAIGN_ID=229&LR_SCHEMA=vast2 preroll,http://ad3.liverail.com/?LR_PUBLISHER_ID={LR_ID}&LR_CAMPAIGN_ID=229&LR_SCHEMA=vast2 midroll 10"></div>

VAST Tags can be included in the Arpeggio player at two levels: Set globally on the account-level, or set on a per-embed basis.

Requirements

Known Limitations

Adding VAST Tags to All Account Videos

To set a single VAST tag on all your videos, please create a support ticket.

Manually Adding VAST Tag(s) to Embed Codes

The Arpeggio player supports the ability to add multiple VAST tags to allow for multiple advertisements. Attributes for each tag should be separated by a space, and the individual tags by a comma. (See the example on the side for an example)

Ad Maps

You can add parameters to each VAST Tag included at the end of the tag that determines where the ad plays in the video:

Please see the embedding example on the right to see these in use.

Arpeggio Player (v2) API

Embedding

<script type="text/javascript" src="//static.cdn-ec.viddler.com/js/arpeggio/v2/build/main-built.js"></script>
    <div id="my-player">
</div>

Include the above script

    var embed = new ViddlerEmbed({
    videoId: '8071d704',
    width: '600px',
    target: '#my-player'
    }); 

Inialzing a Player Object via JavaScript

  1. Include the Arpeggio JavaScript library in the head of your page (see sidebar)
  2. Create a placeholder div where you want the player to be embedded, this should have a unique id attribute:
  3. Initialize a ViddlerEmbed object. The initializer takes a JavaScript object for the settings.

Options for the Initializer

Required

Optional

Events

  embed.manager.events.on('event-name-here', function() {
      //Do something here to handle the event
  });

Handling Events

Event Names

Controlling the Video

Getting Player Status

Linking Embeds

    var player   = new ViddlerEmbed({videoId: abc123});
    var comments = new ViddlerEmbed({videoId: abc123, type: 'comments'});
    player.linkWith(comments);
    comments.linkWith(player);

If you have both a video embed and a comment embed for the same video, you can link them both together to interact with each other. That way if you add a comment in the player, it will be added to the comment embed. To do this, call linkWith on an embed object and pass the other embed object as the argument.

Examples

Demo on JSFiddle

Arpeggio Player (v3)

Enhancements from Version 2

The Version 3 player represents a significant advance in both user experience (particularly on smaller screens) and functionality. Player controls are grouped according to type (playback-related and interactivity-related) with room for additional features planned for 2015.

Browser Compatibility

As an HTML5 Player, functionality can differ between browsers and versions. Please keep in mind that while we try to maintain compatibility whenever possible, we target browser support in line with Google’s browser support policy.

Below is a general list of what can be expected to work on a given set of browsers

Browser Player Load/Playback Media Playback Method Timed Commenting VAST Tag
Internet Explorer 9 (Win) Partial HTML5 (MP4) No Yes
Internet Explorer 10 (Win) Yes HTML5 (MP4) Yes Yes
Internet Explorer 11 (Win) Yes HTML5 (MP4) Yes Yes
Google Chrome (38+) (Win / OS X / Linux ) Yes HTML5 (MP4) Yes Yes
Firefox (34+) (Mac) Yes HTML5 (MP4)* Yes Yes
Firefox (34+) (Win) Yes HTML5 (MP4)* Yes Yes
Safari (7+) (OS X) Yes HTML5 (MP4) Yes Yes
Mobile Safari (iOS 7+) Yes (iPhone uses native player controls) HTML5 (MP4) No No
Mobile Chrome (38+) Yes HTML5 (MP4) Yes No

* With compatible H.264 Decoder Installed

Known Limitations

CSS Customization

The core DOM structure of the player is namespaced under .viddler-app-wrap div.viddler-embed. All selectors below are assumed to be nested under it. The font-family can be changed at this level to change the font used throughout the player.

Modals

Buttons

Play overlay button

The following classes have css rules for the play overlay button. It is currently made with pure css, but you could apply a background to the the main .play-overlay-button and hide the span.

GUI / controls

Whilst individual icons can be targeted, the icons are all images. Therefore, if colors are the only thing to be changed, it is best to use the GUI at viddler.com, to ensure that all possible icons are updated.

Bar

VAST Tag Support

<script type="text/javascript" src="//static.cdn-ec.viddler.com/js/arpeggio/v3/build/main-built.js"></script>

<div class="viddler-auto-embed" data-video-id="d3f8c4ac" data-width="437" data-vast-urls="http://ad3.liverail.com/?LR_PUBLISHER_ID={LR_ID}&LR_CAMPAIGN_ID=229&LR_SCHEMA=vast2 preroll,http://ad3.liverail.com/?LR_PUBLISHER_ID={LR_ID}&LR_CAMPAIGN_ID=229&LR_SCHEMA=vast2 midroll 10"></div>

VAST Tags can be included in the Arpeggio player at two levels: Set globally on the account-level, or set on a per-embed basis.

Requirements

Known Limitations

Adding VAST Tags to All Account Videos

To set a single VAST tag on all your videos, please create a support ticket.

Manually Adding VAST Tag(s) to Embed Codes

The Arpeggio player supports the ability to add multiple VAST tags to allow for multiple advertisements. Attributes for each tag should be separated by a space, and the individual tags by a comma. (See the example on the side for an example)

Ad Maps

You can add parameters to each VAST Tag included at the end of the tag that determines where the ad plays in the video:

Please see the embedding example on the right to see these in use.

Arpeggio Player (v3) API

Embedding

<script type="text/javascript" src="//static.cdn-ec.viddler.com/js/arpeggio/v3/build/main-built.js"></script>
    <div id="my-player">
</div>

Include the above script

    var embed = new ViddlerEmbed({
    videoId: '8071d704',
    width: '600px',
    target: '#my-player'
    }); 

Inialzing a Player Object via JavaScript

  1. Include the Arpeggio JavaScript library in the head of your page (see sidebar)
  2. Create a placeholder div where you want the player to be embedded, this should have a unique id attribute:
  3. Initialize a ViddlerEmbed object. The initializer takes a JavaScript object for the settings.

Options for the Initializer

Required

Optional

Embed Code Parameters

<script type="text/javascript" src="//static.cdn-ec.viddler.com/js/arpeggio/v3/build/main-built.js"></script>

<div class="viddler-auto-embed" data-video-id="{video_id}" data-width="437" data-height="317"></div>

These data attributes are a part of each individual embed code.

data-subtitle-display-style Options

Style Text Color BG Color Attribute
shadow white black none required (default)
shadow black white data-subtitle-display-style="black-on-white-shadow"
block black white data-subtitle-display-style="black-on-white-block"
block white black data-subtitle-display-style="white-on-black-block"

Events

  embed.manager.events.on('event-name-here', function() {
      //Do something here to handle the event
  });

Handling Events

Event Names

Manager / Timeline

Errors

GUI

Interactions

Video Media Element Specific

Comment List Media Element / Timeline Comments Media Element / Comment Creator Submodule

General Analytics Feature

Controlling the Player

Getting Player Status

Manifests

 var options = {
  videoId : ['8071d704'],
  type: 'video',
  embed: player
};

new ViddlerEmbed.ManifestBuilder(options, function(manifest) {
  manifest.features.general_analytics = {
   resourceData: {
     url: '//matthewfawcett.co.uk/arpeggio-analytics-endpoint.php'
   }
  }
  player.embedManifest(manifest);
});

Using the manifest builder to extend an embed.

A manifest is a data structure that informs the player of everything it needs to know for a given embed. By default, when a videoid is passed, the player will use it’s built-in Manifest Builder to generate a manifest object without any further interaction.

While it is possible to build out an interface manually, it is far easier to utilize Arpeggio’s built-in Manifest Builder. Check the example on the right to see how to utilize this functionality.

Chaptering

var manifest = {
  tracks: [...],
  features: {
    chaptering = {
     resourceData: {
       chapters: [
         {
           time: 10000,
           name: 'Chapter 1'
         },
         {
           time: 20000,
           name: 'Chapter 2'
         }
       ]
     }
  }
};

The chaptering feature of Arpeggio allows for the creation of chapters (as on a DVD) each consisting of a name and time point.

There are two methods to set up chaptering on a video:

Setting up Chapters via the Viddler Interface

The easiest method to define chapters in a video is via the Viddler interface. The chaptering setup can be found in the Interaction tab of the Video Manage page.

Defining Chapters in a Manifest

Within the features key of the JSON manifest, create a new key for chaptering. This object will contain a key called resourceData which declares the configuration for a given feature. resourceData should then contain a key called chapters which contains the value of an array of chapters. Each defined chapter must contain time (in milliseconds) and a name.

Demo

See this Demo on JSFiddle Which uses the manifest builder functionality to build out a manifest

General Analytics

Setting up the library

This feature is an optional library that will send analytics data to a configurable endpoint. It accepts two options in the resourceData section of the manifest. These are:

By default the eventsToRecord array is GeneralAnalytics, videoPlayer:play. The GeneralAnalytics regular expression currently only matches one event which is GeneralAnalytics:PercentMilestoneReached but we may add more events in the future.

Setting up your server side endpoint

When an event is triggered that matches eventsToRecord, a HTTP POST request will be made to your server (POST is used over GET because the data sent has a potential to be more than the allowed length of urls). You may want to enable CORS headers on your endpoint which will stop any console errors, but it is not necessary because the feature does not attempt to read the response)

The POST request will include the following parameters:

Migrating from v2 to v3

Changing Embeds

// Old Javascript URL
<script type="text/javascript" src="//static.cdn-ec.viddler.com/js/arpeggio/v2/build/main-built.js"></script>

// New Javascript URL
<script type="text/javascript" src="//static.cdn-ec.viddler.com/js/arpeggio/v3/build/main-built.js"></script>

To change basic embeds, simply change the version in the URL from v2 to v3 (See the example to the right).

JavaScript Function Changes

Webcam Recorder

Viddler’s webcam recorder is a powerful interaction tool, which can be embedded on your own site. This functionality requires Adobe Flash and as a result will not work on mobile devices.

Embedding the Recorder

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="449" height="545"
id="viddler_recorder" align="middle"> <param name="allowScriptAccess" value="always" /> <param name="allowNetworking" value="all" /> <param name="movie" value="http://static.cdn-ec.viddler.com/flash/recorder.swf" /> <param name="quality" value="high" /> <param name="scale" value="noScale"> <param name="bgcolor" value="#000000" /> <param name="flashvars" value="fake=1&recordToken=[YourRecordTokenHere]" /> <embed src="http://static.cdn-ec.viddler.com/flash/recorder.swf" quality="high" scale="noScale" bgcolor="#000000"
allowScriptAccess="always" allowNetworking="all" width="449" height="545" name="viddler_recorder"
flashvars="fake=1&recordToken=[YourRecordTokenHere]" align="middle" type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
  1. Use the API to authenticate via viddler.users.auth. Make sure to add the get_recodred_token=1 parameter to the method call.
  2. Use the record_token provided inside the recorder embed code.

Parameters

Recorder JavaScript API

Controlling the Recorder

The webcam controller can be controlled using the following JavaScript functions:

Callbacks

Flash Player

Viddler’s legacy Flash-based player comes in three flavors: Full, Simple, and Mini. The Full player has all features (video playback and interactive commenting), and as a result has increased load time and screen space. The Simple and Mini players only provide for video playback functionality.

Player Parameters

For ‘boolean’ entries, you can use either t/f, true/false, or 1/0. For example autoplay=t will result in the video autoplaying on load.

Customizing the Player

The Flash Players can have their colors altered on-the-fly, or via Viddler’s settings on an account-wide basis.

LiveRail Integration

When using our Flash Player types, Advertising is handled through our partner, LiveRail. By default, we only send along basic information to identify your LiveRail account. If you need to make customizations (to allow more ads to appear, or for targeting) you will have to add parameters to your embed code.

Parameter Syntax

In LiveRail’s documentation, the parameters use the LR_{tag_name} syntax. When adding a parameter to a Flash Player embed code, you must use the format liveral{tag_name}={value} For example, to add a content tag, you would use liverailTAGS=test.

A Common Use Case: Configuring Mutliple In-Stream Ads

liverailADMAP=in::0

As single pre-roll ad (Default)

liverailADMAP=in::0;in::100%

1 pre-roll and 1 post-roll video ad

liverailADMAP=in:example_scenario:5%;ov::10%,50%

1 mid-roll from a test scenario and 1 overlay ad

<iframe id="viddler-51271da7" src="//www.viddler.com/embed/51271da7?f=1&autoplay=0&player=full&secret=64215889&loop=0&nologo=0&hd=0& liverailADMAP=in::0;in::100%" width="437" height="288" frameborder="0" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>

As part of an embed code

The following syntax is used in this case: liverailADMAP={Type}:{Inventory_scenario_id}:{Time}

oEmbed

http://www.viddler.com/oembed/?format=json&url=http://www.viddler.com/v/bdce8c7

oEmbed is an open standard for embedding media into a web site using just a URL to retrieve the proper data.

Endpoint

The endpoint URL is http://www.viddler.com/oembed/

Parameters

Flash Player API

The JavaScript API for our Flash Players are below. This allows control of the Flash player ONLY, the HTML 5 portion of the Flash Player embed does not accept these commands or trigger events.

Setting up

Add parameter to Embed Code

Make sure the enablejsapi=t parameter is added to the embed code to enable the JavaScript functionality for a given video embed.

<script src="http://static.cdn-ec.viddler.com/js/vapi.js" type="text/javascript"><!--mce:0--></script>

Include the JavaScript Viddler Library

function getPlayer(player_id)
{
    return Viddler(player_id);
}

Obtaining the Player Object

API Controls

Loading Video

cueVideoByKey and cueVideoByID

Loads the specified video’s thumbnail and prepares the player to play the video. The player does not request the FLV until playVideo() or seekTo() is called.

function cueVideoByKey(videoKey:String,
    startSeconds:Number = 0,
    suggestedQuality:String = null,
    secretCode:String = null):void;

cueVideoByUsernameAndVideoNumber

function cueVideoByUsernameAndVideoNumber(
    username:String,
    videoNumber:Number,
    startSeconds:Number = 0,
    suggestedQuality:String = null,
    secretCode:String = null):void;

loadVideoByKey and loadVideoById

Loads the specified video’s thumbnail and prepares the player to play the video. The player does not request the FLV until playVideo or seekTo is called.

function loadVideoByKey(videoKey:String,
    startSeconds:Number = 0,
    suggestedQuality:String = null,
    secretCode:String = null):void;

loadVideoByUsernameAndVideoNumber

Deprecated.

function loadVideoByUsernameAndVideoNumber(username:String,
    videoNumber:Number,
    startSeconds:Number = 0,
    suggestedQuality:String = null,
    secretCode:String = null):void;

Video Playback Controls

playVideo

Plays the currently cued/loaded video.

function playVideo():void;

pauseVideo

function pauseVideo():void;

Pauses the currently playing video.

stopVideo

function stopVideo():void;

Stops the current video. This function also cancels the loading of the video.

seekTo

function seekTo(seconds:Number,
    allowSeekAhead:Boolean = true):void;

Seeks to the specified time of the video in seconds. The seekTo() function will look for the closest keyframe before the seconds specified. This means that sometimes the play head may seek to just before the requested time, usually no more than ~2 seconds.

The allowSeekAhead parameter determines whether or not the player will make a new request to the server if seconds is beyond the currently loaded video data.

Volume Controls

mute

function mute():void;

Mutes the player.

unMute

function unMute():void;

Unmutes the player.

isMuted

function isMuted(callbackName:String = null):Boolean;
function isMuted():Boolean;

Returns if the player is muted, false if not

setVolume

function setVolume(volume:Number):void;

Sets the volume. Accepts an integer between 0 and 100.

getVolume

function getVolume(callbackName:String = null):Number;
function getVolume():Number;

Returns the player’s current volume, an integer between 0 and 100. Note that getVolume() will return the volume even if the player is muted.

Player Dimensions

setSize

Sets the player size (in pixels)

function setSize(width:Number, height:Number):void;

Playback Status

getVideoBytesLoaded

function getVideoBytesLoaded(callbackName:String = null):Number;
function getVideoBytesLoaded():Number;

Returns the current amount of data loaded (in bytes) for the current video.

getVideoSecondsLoaded

function getVideoSecondsLoaded(callbackName:String = null):Number;
function getVideoSecondsLoaded():Number;

Returns the current amount of time loaded (in seconds) for the current video.

getVideoBytesTotal

function ggetVideoBytesTotal(callbackName:String = null):Number;
function getVideoBytesTotal():Number;

Returns the total video size (in bytes) of the currently loaded video.

getVideoStartBytes

function getVideoStartBytes(callbackName:String = null):Number;
function getVideoStartBytes():Number;

Returns the total video size (in bytes) of the currently loaded video.

getVideoStartSeconds

function getVideoStartSeconds(callbackName:String = null):Number;
function getVideoStartSeconds():Number;

Returns the number of bytes the video file started loading from. Example scenario: the user seeks ahead to a point that hasn’t loaded yet, and the player makes a new request to play a segment of the video that hasn’t loaded yet.

getCurrentTime

function getCurrentTime(callbackName:String = null):Number;
function getCurrentTime():Number;

Returns the elapsed time in seconds since the video started playing.

getPlayerState

function getPlayerState(callbackName:String = null):Number;
function getPlayerState():Number;

Returns the state of the player. Possible values are: not started (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5).

Playback Quality

getPlaybackQuality

function getPlaybackQuality(callbackName:String = null):String;
function getPlaybackQuality():String;

This function retrieves the actual video quality of the current video. It returns null if there is no current video. Possible return values are hd720, high, normal.

setPlaybackQuality

This function sets the suggested video quality for the current video. The function causes the video to reload at its current position in the new quality. If the playback quality does change, it will only change for the video being played.

Calling this function does not guarantee that the playback quality will actually change. If the playback quality does change, it will only change for the video being played. At that time, the onPlaybackQualityChange event will fire, and your code should respond to the event rather than the fact that it called the setPlaybackQuality function.

The suggestedQuality parameter value can be normal, high, hd720 or default. Setting the parameter value to default instructs Viddler to select the most appropriate playback quality, which will vary for different users, videos, systems and other playback conditions.

If you call the setPlaybackQuality function with a suggestedQuality level that is not available for the video, then the quality will be set to the next lowest level that is available. For example, if you request a quality level of high, and that is unavailable, then the playback quality will be set to normal (as long as that quality level is available).

In addition, setting suggestedQuality to a value that is not a recognized quality level is equivalent to setting suggestedQuality to default.

function setPlaybackQuality(suggestedQuality:String):void;

getAvailableQualityLevels

function getAvailableQualityLevels(callbackName:String = null):Array;
function getAvailableQualityLevels():Array;

This function returns the set of quality formats in which the current video is available. You could use this function to determine whether the video is available in a higher quality than the user is viewing, and your player could display a button or other element to let the user adjust the quality.

The function returns an array of strings ordered from highest to lowest quality. Possible array element values are hd720, high, normal. This function returns an empty array if there is no current video.

Your client should not automatically switch to use the highest (or lowest) quality video or to any unknown format name. Viddler could expand the list of quality levels to include formats that may not be appropriate in your player context. Similarly, Viddler could remove quality options that would be detrimental to the user experience. By ensuring that your client only switches to known, available formats, you can ensure that your client’s performance will not be affected by either the introduction of new quality levels or the removal of quality levels that are not appropriate for your player context.

Video Data

getVideoKey

function getVideoKey(callbackName:String = null):String;
function getVideoKey():String;

Returns key of the currently playing video Note that getVideoKey() will return null until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getDuration

function getDuration(callbackName:String = null):Number;
function getDuration():Number;

Returns the duration in seconds of the currently playing video. Note that getDuration() will return 0 until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getVideoUrl

function getVideoUrl(offset:Number = 0,
    callbackName:String = null):String;
function getVideoUrl(offset:Number = 0):String;

TReturns the Viddler.com URL or permalink for the currently loaded/playing video. Note that getVideoUrl() will return null until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getVideoEmbedCode

function getVideoEmbedCode(playerUrl:String = null,
    offset:Number = 0,
    width:Number = 0,
    height:Number = 0,
    controlPanelHeight:Number = 0,
    callbackName:String = null):String;
function getVideoEmbedCode(playerUrl:String = null,
    offset:Number = 0,
    width:Number = 0,
    height:Number = 0,
    controlPanelHeight:Number = 0):String;

Returns the embed code for the currently loaded/playing video. Note that getVideoEmbedCode() will return null until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getVideoTitle

function getPlaybackQuality(callbackName:String = null):String;
function getPlaybackQuality():String;

Returns title. Note that getVideoTitle() will return null until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getAuthorName

function getAuthorName(callbackName:String = null):String;
function getAuthorName():String;

Returns video’s author’s name. Note that getAuthorName() will return null until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getAuthorAvatarUrl

function getAuthorAvatarUrl(callbackName:String = null):String;
function getAuthorAvatarUrl():String;;

Returns video’s author’s avatar’s url. Note that getAuthorAvatarUrl() will return null until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getViewsCount

function getViewsCount(callbackName:String = null):Number;
function getViewsCount():Number;

Returns number of views for current video. Note that getViewsCount() will always return -1 until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getCommentsCount

function getCommentsCount(callbackName:String = null):Number;
function getCommentsCount():Number;

Returns number of comments for current video. Note that getCommentsCount() will always return -1 until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

getFavoritesCount

function getFavoritesCount(callbackName:String = null):Number;
function getFavoritesCount():Number;

Returns number of users that favorited this video. Note that getFavoritesCount() will always return -1 until the video’s info is loaded, which normally happens just after cueVideoBy* or loadVideoBy* call. Player state PLAYER_STATE_VIDEO_CUED indicates that video’s info is loaded.

Comments

CommentInfo

Data object representing comment. Properties in ActionScript and JavaScrip

public var dateAdded:Date; // date the comment was added
public var id:Number; // comment id
public var test:String; // comment content
public var videoId:Number; // id of video that this comment belongs to
public var posterId:Number; // id of comment author
public var posterImage:String; // url to avatar of comment author
public var posterName:String; // name of comment author
public var startTime:Number; // comment timepoint
public var rating:Number; // current comment rating
public var ratedAs:Number; // if -1 current user rated this comment negatively, if 1 current user rated this comment positively, if 0 current user didn't rate this comment
public var replyToId:number; // id of comment that this comment is a reply to
public var videoReply:Boolean; // true if this comment is video comment
public var videoUrl:String; // url to flv file of the video comment
public var moderationStatus:Number; // moderations status (-1 refused, 0 pending review, 1 approved, 2 denied)

getComments

function getComments(callbackName:String = null):Array;
function getComments():Array;

Returns comments of current video. This method returns array of CommentInfo objects.

saveComment

Saves comment as current user. This function will send request to Viddler’s servers to save comment and upon receiving response it will dispatch event onSaveCommentResult. text is the comment’s content. startTime is the comment’s timepoint in seconds (float). replyToId is the parent comment’s id (this is passed to function when we want to indicate that this comment is a response). username is user’s name used only when player is in anonymous commenting mode.

function saveComment(text:String,
    startTime:Number,
    replyToId:Number = 0,
    username:String = null):void;

deleteComments

Delete comment. id is comment’s id. This function will send request to viddler’s server to delete comment and upon receiving response it will dispatch event: onDeleteCommentResult.

function deleteComment(id:Number):void;

rateComment

Rates comment. id is comment’s id. rating is user’s rating of current comment: -1 negative, 0 neutral, 1 positive. This function will send a request to Viddler’s server to rate the comment and it will dispatch event onRateCommentResult on completion.

function rateComment(id:Number, rating:Number):void;

Event Listeners

addEventListener

function addEventListener(type:String,
    listenerName:String):void
function addEventListener(type:String,
    listener:Function,
    useCapture:Boolean=false,
    priority:int=0,
    useWeakReference:Boolean=false):void;

This Function differs depending on the language in use:

JavaScript: Adds a listener function for the specified event. The Events section identifies the different events that the player might fire. The listenerName is a name off the function that will execute when the specified event fires.

ActionScript 3: Adds a listener function for the specified event. The Events section identifies the different events that the player might fire. The listener is a reference to the function that will execute when the specified event fires.

Events

onReady

This event is fired when the player is loaded and initialized, meaning it is ready to receive API calls.

onStateChange

This event is fired whenever the player’s state changes. Possible values are not started (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5). When the SWF is first loaded it will broadcast an unstarted (-1) event. When the video is cued and ready to play it will broadcast a video cued event (5).

onPlaybackQualityChange

This event is fired whenever the video playback quality changes. For example, if you call the setPlaybackQuality function, this event will fire if the playback quality actually changes. Your code should respond to the event and should not assume that the quality will automatically change when the setPlaybackQuality function is called. Similarly, your code should not assume that playback quality will only change as a result of an explicit call to setPlaybackQuality or any other function that allows you to set a suggested playback quality.

The value that the event broadcasts is the new playback quality. Possible values are “normal”, “high” and “hd720″.

onError

This event is fired when an error in the player occurs. The possible error codes are 100 and 111. The 100 error code is broadcast when the video requested is not found. This occurs when a video has been removed (for any reason) or it never existed in the first place. Verbose meaning of 100 error is ‘not found’. The 111 error code is broadcast when the video requested is marked as private or is not available to current user. Verbose meaning of 111 error is ‘forbidden’.

onBrandingUpdate

This event is fired when new branding info is loaded. Data contains new BrandingInfo object. If data is null, skin should use default branding.

onSecurityUpdate

This event is fired when security is updated after loading new video info or updating old one. Data property contains SecurityManagerInterface instance.

onSaveCommentResult

This event is fired when saveComment function is called. Data contains new CommentInfo object if saving was successful or null if player wasn’t able to save the comment.

onRateCommentResult

This event is fired when rateComment function is called. Data contains result: 0 success, 1 error.

onDeleteCommentResult

This event is fired when deleteComment function is called. Data contains result: 0 success, 1 error.

Examples

Loading the Player

See the sidebar to the right to learn how load the player in ActionScript 3.

package {
   import flash.display.Loader;
   import flash.display.Sprite;
   import flash.events.Event;
   import flash.net.URLRequest;
   import flash.system.Security;

   public class LoadExample extends Sprite {

      // This loader will be used to load chromeless player
      private var loader:Loader;

      // This will hold chromeless player instance
      private var player:Object;

      public function LoadExample() {
         loader = new Loader();
         loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
         loader.load(new URLRequest("http://www.viddler.com/chromeless/"));
      }

      private function onLoaderInit(event:Event):void {
         addChild(loader);
         Security.allowDomain(loader.contentLoaderInfo.url);
         loader.content.addEventListener(ChromelessPlayerConstants.EVENT_READY, onPlayerReady);
         loader.content.addEventListener(ChromelessPlayerConstants.EVENT_ERROR, onPlayerError);
         loader.content.addEventListener(ChromelessPlayerConstants.EVENT_STATE_CHANGE, onPlayerStateChange);
         loader.content.addEventListener(ChromelessPlayerConstants.EVENT_PLAYBACK_QUALITY_CHANGE, onPlayerPlaybackQualityChange);
      }

      private function onPlayerReady(event:Event):void {
         trace('player ready:', Object(event).data);
         player = loader.content;
         player.setSize(480, 360);
      }

      private function onPlayerError(event:Event):void {
         trace('player error:', Object(event).data);
      }

      private function onPlayerStateChange(event:Event):void {
         trace('player state:', Object(event).data);
      }

      private function onPlayerPlaybackQualityChange(event:Event):void {
         trace('video quality:', Object(event).data);
      }
   }
}

Example Skin

You can download a example skin here. The source is also available on Github.

(The following links need to be depreciated when everything is on GitHub.) Example skin can be seen here: http://developers.viddler.com/files/chromeless/ExampleSkin.swf

package {
   import flash.display.Graphics;
   import flash.display.Loader;
   import flash.display.Sprite;
   import flash.display.StageAlign;
   import flash.display.StageScaleMode;
   import flash.events.Event;
   import flash.events.MouseEvent;
   import flash.events.TimerEvent;
   import flash.net.URLRequest;
   import flash.system.Security;
   import flash.text.TextField;
   import flash.text.TextFieldAutoSize;
   import flash.utils.Timer;

   [SWF(width="600", height="400", fps="10")]
   public class ExampleSkin extends Sprite {

      private var loader:Loader;

      private var player:Object;

      private var playButton:Sprite;

      private var stopButton:Sprite;

      private var statusField:TextField; 

      private var volumeField:TextField;

      private var bytesTotalField:TextField;

      private var bytesLoadedField:TextField;

      private var bytesStartField:TextField;

      private var durationField:TextField;

      private var currentTimeField:TextField;

      public function ExampleSkin() {
         stage.scaleMode = StageScaleMode.NO_SCALE;
         stage.align = StageAlign.TOP_LEFT;

         createButtons();
         createFields();

         stage.addEventListener(Event.RESIZE, onStageResize);

         var timer:Timer = new Timer(250);
         timer.addEventListener(TimerEvent.TIMER, onTimer);
         timer.start();

         loader = new Loader();
         loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
         if (loaderInfo.url.charAt(0) == 'f') {
            loader.load(new URLRequest("ChromelessPublisher.swf"));
         } else {
            loader.load(new URLRequest("http://www.viddler.com/chromeless/"));
         }
      }

      private function onLoaderInit(event:Event):void {
         trace('onLoaderInit, event:', event);
         addChild(loader);
         Security.allowDomain(loader.content.loaderInfo.url);
         loader.content.addEventListener(ChromelessPlayerConstants.EVENT_READY, onPlayerReady);
         loader.content.addEventListener(ChromelessPlayerConstants.EVENT_ERROR, onPlayerError);
         loader.content.addEventListener(ChromelessPlayerConstants.EVENT_STATE_CHANGE, onPlayerStateChange);
         loader.content.addEventListener(ChromelessPlayerConstants.EVENT_PLAYBACK_QUALITY_CHANGE, onPlayerPlaybackQualityChange);
      }


      private function onPlayerReady(event:Event):void {
         trace('onPlayerReady, event:', event);
         player = loader.content;
         addChild(stopButton);
         addChild(playButton);
         addChild(statusField);
         addChild(volumeField);
         addChild(bytesTotalField);
         addChild(bytesLoadedField);
         addChild(bytesStartField);
         addChild(durationField);
         addChild(currentTimeField);
         onStageResize(null);
         player.cueVideoByKey('e304f492');
//       player.loadVideoByKey('e304f492');
      }

      private function onPlayerError(event:Event):void {
         trace('onPlayerError, event: ' + event);  
      }

      private function onPlayerStateChange(event:Event):void {
         trace('onPlayerStateChange, event: ' + event);
         var data:Number = Object(event).data;
         if (data == ChromelessPlayerConstants.PLAYER_STATE_UNSTARTED) {
            updateStatus('unstarted');
            removeButtonClickListener(playButton, playButtonClickListener);
         } else if (data == ChromelessPlayerConstants.PLAYER_STATE_ENDED) {
            updateStatus('ended');
            setButtonLabel(playButton, 'replay');
            addButtonClickListener(playButton, playButtonClickListener);
            removeButtonClickListener(stopButton, stopButtonClickListener);
         } else if (data == ChromelessPlayerConstants.PLAYER_STATE_PLAYING) {
            setButtonLabel(playButton, 'pause');
            addButtonClickListener(playButton, playButtonClickListener);
            updateStatus('playing');
            addButtonClickListener(stopButton, stopButtonClickListener);
         } else if (data == ChromelessPlayerConstants.PLAYER_STATE_PAUSED) {
            setButtonLabel(playButton, 'play');
            addButtonClickListener(playButton, playButtonClickListener);
            updateStatus('paused');
            addButtonClickListener(stopButton, stopButtonClickListener);
         } else if (data == ChromelessPlayerConstants.PLAYER_STATE_BUFFERING) {
            setButtonLabel(playButton, 'pause');
            addButtonClickListener(playButton, playButtonClickListener);
            updateStatus('buffering');
            addButtonClickListener(stopButton, stopButtonClickListener);
         } else if (data == ChromelessPlayerConstants.PLAYER_STATE_VIDEO_CUED) {
            setButtonLabel(playButton, 'play');
            addButtonClickListener(playButton, playButtonClickListener);
            updateStatus('video cued');
         }
      }

      private function onPlayerPlaybackQualityChange(event:Event):void {
         trace('onPlayerPlaybackQualityChange, event:', event);
      }

      private function onStageResize(event:Event):void {
         trace('onStageResize, event:', event);
         if (player != null) {
            player.setSize(stage.stageWidth, stage.stageHeight);
         }
         var padding:Number = 10;
         var y:Number = stage.stageHeight - 30;

         stopButton.x = padding;
         stopButton.y = y;

         playButton.x = stopButton.x + stopButton.width + padding;
         playButton.y = y;

         statusField.x = padding;
         statusField.y = padding;

         volumeField.x = statusField.x;
         volumeField.y = statusField.y + statusField.height + padding;

         bytesTotalField.x = volumeField.x;
         bytesTotalField.y = volumeField.y + volumeField.height + padding;

         bytesLoadedField.x = bytesTotalField.x;
         bytesLoadedField.y = bytesTotalField.y + bytesTotalField.height + padding;

         bytesStartField.x = bytesLoadedField.x;
         bytesStartField.y = bytesLoadedField.y + bytesLoadedField.height + padding;

         durationField.x = bytesStartField.x;
         durationField.y = bytesStartField.y + bytesStartField.height + padding;

         currentTimeField.x = durationField.x;
         currentTimeField.y = durationField.y + durationField.height + padding;
      }

      private function createTextField():TextField {
         var textField:TextField = new TextField();
         textField = new TextField();
         textField.background = true;
         textField.backgroundColor = 0xFFFFFF;
         textField.selectable = false;
         textField.autoSize = TextFieldAutoSize.LEFT;
         textField.text = 'none';
         return textField;
      }

      //
      // Fields
      //

      private function createFields():void {
         statusField = createTextField();
         volumeField = createTextField();
         updateVolume(0);
         bytesTotalField = createTextField();
         updateBytesTotal(0);
         bytesLoadedField = createTextField();
         updateBytesLoaded(0);
         bytesStartField = createTextField();
         updateBytesStart(0);
         durationField = createTextField();
         updateDuration(0);
         currentTimeField = createTextField();
         updateCurrentTime(0);
      }

      private function updateStatus(status:String):void {
         statusField.text = status;
      }

      private function updateVolume(volume:Number):void {
         volumeField.text = 'Volume: ' + volume;
      }

      private function updateBytesLoaded(bytesLoaded:Number):void {
         bytesLoadedField.text = 'Bytes loaded: ' + bytesLoaded;
      }

      private function updateBytesTotal(bytesTotal:Number):void {
         bytesTotalField.text = 'Bytes total: ' + bytesTotal;
      }

      private function updateBytesStart(bytesStart:Number):void {
         bytesStartField .text = 'Bytes start: ' + bytesStart;
      }

      private function updateDuration(duration:Number):void {
         durationField.text = 'Duration: ' + duration;
      }

      private function updateCurrentTime(currentTime:Number):void {
         currentTimeField.text = 'Current time: ' + currentTime;
      }

      //
      // Update timer
      // 

      private function onTimer(event:TimerEvent):void {
         if (player) {
            updateVolume(player.getVolume());
            updateBytesLoaded(player.getVideoBytesLoaded());
            updateBytesTotal(player.getVideoBytesTotal());
            updateBytesStart(player.getVideoStartBytes());
            updateDuration(player.getDuration());
            updateCurrentTime(player.getCurrentTime());
         }
      }

      //
      // Buttons
      //

      private function createButtons():void {
         playButton = createPlayButton();
         stopButton = createStopButton();
      }

      private function createPlayButton():Sprite {
         return createButton('play');
      }

      private function createStopButton():Sprite {
         return createButton('stop');
      }

      private function playButtonClickListener(e:MouseEvent):void {
         if (getButtonTextField(playButton).text == 'play') {
            player.playVideo();
         } else if (getButtonTextField(playButton).text == 'pause') {
            player.pauseVideo();
         } else if (getButtonTextField(playButton).text == 'replay') {
            player.seekTo(0);
            player.playVideo();
         }
      }

      private function stopButtonClickListener(e:MouseEvent):void {
         player.stopVideo();
      }


      private function createButton(label:String):Sprite {
         var tf:TextField = new TextField();
         tf.autoSize = TextFieldAutoSize.LEFT;
         tf.background = true;
         tf.backgroundColor = 0xFFFFFF;
         tf.text = label;
         tf.selectable = false;

         var s:Sprite = new Sprite();
         s.addChild(tf);
         tf.x = 0;
         tf.y = 0;
         var m:Sprite = new Sprite();
         s.addChild(m);
         var g:Graphics  = m.graphics;
         g.beginFill(0xFFFFFF, 0.3);
         g.drawRect(0, 0, tf.width, tf.height);
         g.endFill();
         m.x = 0;
         m.y = 0;

         s.addEventListener(MouseEvent.ROLL_OVER, buttonRollOverListener);
         s.addEventListener(MouseEvent.ROLL_OUT, buttonRollOutListener);
         return s;
      }

      private function buttonRollOverListener(e:MouseEvent):void {
         getButtonTextField(e.target).backgroundColor = 0xCCCCCC;
      }

      private function buttonRollOutListener(e:MouseEvent):void {
         getButtonTextField(e.target).backgroundColor = 0xFFFFFF;
      }

      private function getButtonTextField(o:Object):TextField {
         return (o as Sprite).getChildAt(0) as TextField;
      }

      private function addButtonClickListener(button:Sprite, listener:Function):void {
         button.addEventListener(MouseEvent.CLICK, listener);
         button.buttonMode = true;
      }

      private function removeButtonClickListener(button:Sprite, listener:Function):void {
         button.removeEventListener(MouseEvent.CLICK, listener);
         button.buttonMode = false;
      }

      private function setButtonLabel(o:Sprite, label:String):void {
         getButtonTextField(o).text = label;
      }


   }
}