Define skippable content (tvOS)

Specify sections of content that a viewer can skip




The JWPlayerTVKit for tvOS has the capability to define sections of content that the user can skip. These skippable sections can be defined in two ways:

  • Skippable time ranges
  • Skippable chapters

The following sections explain how to define each type of skippable section.



Define skippable time ranges

By supplying an array of JWSkippableTimeRange objects, skippable time ranges can be defined within a JWPlayerItem. You can use the JWSkippableTimeRangeBuilder() to create the array of JWSkippableTimeRange objects.

Use the following recipe to define skippable time ranges.


πŸ’‘

Alternatively, skippable time ranges can be defined within a JSON configuration and a configuration object created with JWJSONParser. Consult the header documentation and the following JSON object for an example of how to define skippable time ranges.

{
   "playlist": [{
       "title": "VIDEO TITLE",
       "image": "POSTER-IMAGE.jpg",
       "sources": [{
           "file": "VIDEO-FILE.mp4"
       }],
       "skippableRanges": [{
               "buttonText": "Skip Intro",
               "buttonDisplayTime": {
                   "start": 0.0,
                   "end": 10.0,
               },
               "seekTo": 60.0
           },
           {
               "buttonText": "Skip Recap",
               "buttonDisplayTime": {
                   "start": 60.0,
                   "end": 70.0,
               },
               "seekTo": 180.0
           }
       ]
   }]
}


Define skippable chapters

Using JWChapterTrackBuilder(), you can identify chapters a user can skip.

Use the following recipe to define skippable chapters.


πŸ’‘

Alternatively, skippable chapters can be defined within a JSON configuration and a configuration object created with JWJSONParser. Consult the header documentation and the following JSON object for an example of how to define skippable chapters.

{
   "playlist": [{
       "title": "VIDEO TITLE",
       "image": "POSTER-IMAGE.jpg",
       "sources": [{
           "file": "VIDEO-FILE.mp4"
       }],
       "tracks": [{
           "file": "chapter_file_vtt",
           "kind": "chapters",
           "skippableChapters": ["1", "2"],
           "skipButtonDuration": 10.0
       }]
   }]
}