07

AV Player

Initializing the AVPlayer Library

Play, Pause, Stop, and Skip

Handling Remote Control Key Events

Summary

The core purpose of a TV is to consume video content. The Samsung SmartTV supports both broadcasting programs and VOD content to be played in an application using its AVPlayer application library. This chapter will explain major APIs of the AV Player, and show how event functions are declared and called to control the player.

Initializing the AVPlayer Library

VOD-type applications are gaining popularity because they can maximize large screen features of the common SmartTV. The Samsung SmartTV supports two different approaches to play VOD content. The first method is using a standard web HTML tag, and the second method is using the AVPlayer included in the Samsung SmartTV Web Device API. See below for an example of playing contents with the HTML tag method.

<object src=“http://www.w3schools.com/tags/movie.mp4” type=“video/mp4”></
object>
<video src=“http://www.w3schools.com/tags/movie.mp4” type=“video/mp4”></video>
<audio src=“http://www.w3schools.com/tags/audio.mp3” type=“audio/mp3”></audio>

While it is easy to implement the HTML tag approach, it has a drawback of severely limited player control other than the basic attributes supported by the HTML. Mainly, it cannot take advantage of using the focus policy to control player functions, or using callback functions to receive player events.

The following Web Device API's AV Player offers customized player control. ...

Get Samsung SmartTV Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.