v1

latestOpenAPI 3.1.02026-07-24251250397.8 KB
media

Create a media

Create a media

post/v2/sites/{site_id}/media/

Path parameters

site_idstring required

Unique identifier for a resource

Example:Ny05CEfj

Unique alphanumeric ID of the site

Request body

hosting_type'external' | 'hosted' | 'renditions' | 'ott_data'

Indicates how the media asset is hosted.

If hosting_type is omitted, it defaults based on the supplied upload.method for backward compatibility.

Possible values:

  • hosted: JWX hosts the media. Provide a source file using an upload.method of direct, multipart, or fetch, and JWX transcodes it into streaming renditions.

  • external: Register self-hosted content with your JWX account. JWX stores the metadata and references your externally hosted file via upload.source_url instead of hosting the asset itself.

  • renditions: Create a media that uses the CMAF VOD workflow for flexible transcoding and/or delivery. You can have JWX transcode a source file or bring your own pre-encoded custom renditions. Learn more about CMAF VOD. There are two ways to use this hosting type:

    JWX handles transcoding: When creating the media define your upload method and provide the source file for transcoding and rendition creation.

    Bring your own pre-encoded renditions: Create the media then add each custom audio, text, and/or video renditions to the media.

  • ott_data: Create a media that represents OTT (over-the-top) metadata rather than a streamable video file.

Example request

{
  "hosting_type": "renditions",
  "upload": {
    "method": "direct"
  },
  "metadata": {
    "title": "My CMAF VOD asset"
  }
}

Response

Resource successfully created

schemastring
idstring

Unique identifier for a resource

createdstring

Date and time at which the resource was created

last_modifiedstring

Date and time at which the resource was most recently modified

typestring

Name of the type of resource.

status'created' | 'processing' | 'ready' | 'updating' | 'failed'

Media upload status

media_type'audio' | 'video'
hosting_type'external' | 'hosted' | 'renditions'

Indicates whether JW Platform hosts and transcodes the media or not. Possible values: - external: The media is transcoded and hosted by a third-party - hosted: The media is transcoded and hosted by JW Platform - renditions: The media is transcoded by a third party but hosted on JW Platform

mime_type'video/mp4' | 'video/webm' | 'video/flv' | 'audio/aac' | 'audio/mpeg' | 'audio/ogg' | 'application/vnd.apple.mpegurl' | 'application/smil+xml' | 'application/dash+xml' | 'video/flash'
error_messagestring

Message describing an issue uploading or processing the media

external_idstring

Non-JWX ID for the media A maximum of 64 characters is permitted.

durationnumber

Length of the media in seconds

trim_in_pointstring

Starting point to trim the video

trim_out_pointstring

Ending point to trim the video

upload_linkstring

URL to be used for S3 uploads

Example response

{
  "schema": "https://schema.jwplayer.com/types/thumbnail.json",
  "id": "Ny05CEfj",
  "created": "2019-09-25T15:29:11.042095+00:00",
  "last_modified": "2019-09-25T15:29:11.042095+00:00",
  "relationships": {
    "protection_rule": {
      "id": "Ny05CEfj"
    }
  },
  "metadata": {
    "title": "My Media Title",
    "description": "My media description",
    "author": "Jane Doe",
    "permalink": "http://www.mysite.com",
    "category": "Automotive",
    "publish_start_date": "2018-10-03T21:19:36.602019+00:00",
    "publish_end_date": "2018-10-03T21:19:36.602019+00:00",
    "tags": [
      "test1",
      "happy1",
      "one",
      "two",
      "four"
    ],
    "custom_params": {
      "param1": "value1"
    }
  },
  "status": "ready",
  "media_type": "video",
  "hosting_type": "hosted",
  "error_message": "Something went wrong!",
  "external_id": "myvideo123",
  "duration": 437,
  "trim_in_point": "00:00:01",
  "trim_out_point": "00:01:00.123"
}