top

Play Audio and Video

Published 2014-10-27 | (Compatible with SDK 2.5,3.5,4.5,5.0,5.1 and 2011,2012,2013,2014 models)

Introduction to playing audio and video on Samsung Smart TV.

Samsung Smart TV provides the following tutorials to create applications that use JavaScript for playing audio and video content:

Creating a Video Application
This tutorial describes the use of video features to create various kinds of applications, like video catch-up services and User Created Content (UCC) services. The application reads title, description and URL information for each video clip and allows the user to play, stop and pause the video and skip forward and backward through it. It positions the video playback in a window or in a full-screen video display. It also provides volume control functions.

HTTP Adaptive Streaming (HAS)

Adaptive streaming is a process that adjusts the quality of a video delivered to a web page based on changing network conditions to ensure the best possible viewer experience. Adaptive streaming technologies are usually based on HTTP and designed to work efficiently over large distributed HTTP networks such as the Internet.

Samsung Smart TV provides the following tutorial to illustrate creating a video application that uses HAS content:

Creating a Video Application With HAS (HTTP Adaptive Streaming)
This tutorial describes the use of the HAS (HTTP Adaptive Streaming) features of the Samsung Applications service. With adaptive streaming users can enjoy seamless video streaming service over IP networks with best possible video quality.

Samsung Smart TV also has specific URL parameters for HAS contents. With these URL parameters, the HAS engine’s logical behaviour can be controlled.

Preventing On-Screen Display (OSD) Distortion

Application images can be distorted if the movie playing in the background makes transitions to quickly. Use the setOnOSDState() and setOffOSDState() methods in the Plugin common module to prevent this. This problem usually appears in single-wide applications and ticker applications, not in full-screen applications.

Closing a Video Application

Stop the player at the registered function in onunload of <body> tag. A video application using Player Plugin should be closed after the player is stopped.

Note

If you end an application without stopping the playing, fatal problems such as TV system pause might occur.