The following questions are related to implementing multimedia playback features.
Video playback using the HTML video element supports external subtitles in WebVTT format. For more information, see Adding Captions and Subtitles.
The AVPlay API supports both internal and external subtitles in a variety of formats. For information on configuring subtitle tracks with the AVPlay API, see Subtitles.
NoteTo display internal subtitles, the user must switch on the "Caption" setting on the TV.
On some TV models, the "Caption" setting is available only when the TV input source is the broadcast signal.
When implementing multitasking, if you use the AVPlay API to play media content, do not call the pause() and play() methods when the application is hidden and resumed. Instead, call the suspend() method to save the playback state, and the restore() method to restore it:
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
// Behavior when the application is hidden
webapis.avplay.suspend();
} else {
// Behavior when the application is resumed
webapis.avplay.restore();
}
});
If you are not using the AVPlay API, you can implement multiple subtitle tracks for an HTML5 video element. For more information, see Adding Captions and Subtitles.
TV
HTV
#subtitle
#audio track
#multiple tracks
No. A video element and an AVPlay instance cannot play content simultaneously.
TV
HTV
#video element
#avplay api
To check whether the TV supports 4K UHD resolution, use the isUdPanelSupported() method of the ProductInfo API.
TV
HTV
#4k uhd
#productinfo api
To retrieve the current playback time, use the getCurrentTime() method. It returns the playback time in milliseconds.
TV
HTV
#avplay api
#playback time
You can specify whether a video is displayed in fullscreen mode, letterbox mode, or the video's aspect ratio, using the setDisplayMethod() method of the AVPlay API.
NoteOverriding the video's original aspect ratio can cause video image distortion.
TV
HTV
#aspect ratio
#override
No. The AVPlay API plays the video content as delivered. It does not support rotating or mirroring the video image.
TV
HTV
#avplay api
#rotate
#mirror
No. Subtitle visibility can be controlled from within the application, but closed captioning must be enabled or disabled in the TV settings. If the media content has both closed captioning and subtitles, you can prompt the user to open the TV settings and disable captioning, or you can avoid implementing software subtitles.
The hotel TVs, however, provide the caption handling methods like getMenuValue() and setMenuValue() with CAPTION_ONOFF_KEY. Refer to the TvInfo API.
TV
HTV
#caption
No, switching the TV audio mode is not supported by the API. The user must select the audio mode from the TV menu.
TV
#audio mode
Yes, the autoplay and loop attributes for the HTML video element are supported on Samsung Smart TVs.
No. Although allowing the user to jump backwards improves the user experience, it is not a required feature. When you submit the application for publishing, if it does not support backwards jump, make sure to mention it in your application UI description file.
TV
HTV
#jump
#backward
To implement launching another application, you need the other application's application ID. Since application IDs are confidential, you can only launch other applications that you have developed.
However, if the streaming service you want to use, such as YouTube, has an HTML embedding functionality, you can use it in your application to stream content from that service.
TV
HTV
#embedding
#html
#streaming content
Make sure the video format is supported by the TV. For information on video format support, see Media Specifications. Implement checks to ensure that the video format is supported before you attempt playback.
TV
HTV
#video element
To handle AVPlay errors, implement the onerror() event handler, which returns the error code. For more information and error code definitions, see the AVPlay API.
TV
HTV
#avplay api
#error code
Make sure the application is setting the correct subtitle track. To retrieve the list of tracks in a media stream:
var trackInfo = webapis.avplay.getTotalTrackInfo();
var text = 'type of track info: ' + typeof trackInfo + '';
text += 'length: ' + trackInfo.length + '';
for (var i = 0; i trackInfo.length; i++) {
text += 'index: ' + trackInfo[i].index + '';
text += 'type: ' + trackInfo[i].type + '';
text += 'extra_info: ' + trackInfo[i].extra_info + '';
}
Make sure you have set the appropriate display area for the content, using the setDisplayRect() method. For more information, see Using AVPlay.
If the media is 4K UHD content, you must also check that the TV supports it and 4K 8K UHD video.
TV
HTV
#avplay api
#no video
Captioning text is rendered with fixed-width (monospace) fonts, which can appear wider than variable-width (proportional) fonts.
TV
HTV
#closed caption
Closed captions are shown only when focus is on the TV broadcast window. To show closed captions in a PiP window, you must move focus to it.
TV
HTV
#closed caption
#picture in picture
The seekTo() method of the AVPlay API cannot be used to move to the video start time (0 milliseconds) or end time. To move to the beginning of a video, you can stop and restart the video, or move to a position close to the beginning, such as 1000 milliseconds.
TV
HTV
#timestamp
#seekto
The connection failed error occurs when the AVPlay instance is unable to access the media content. Make sure the URL is correct, the media server is accessible, and the connection uses the appropriate security settings and certificates.
TV
HTV
#network connection
#media playback
When the media has multiple audio tracks, you must use the setSelectTrack() method to define the audio track to play. The method must be called when the AVPlay instance is in the playing state.
NoteFor Smooth Streaming only, the setSelectTrack() method can also be called during the ready state.
TV
HTV
#multiple audio tracks
#no audio
Yes. The setVolume() method of the TVAudioControl API does not show the TV's built-in volume UI. You must implement your own volume UI.
TV
HTV
#volume level
Poor network connectivity can cause media to load slowly. To inform the user that content is still loading, implement a loading screen.
TV
HTV
#network connectivity
#black screen
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
developer.samsung.com, .samsung.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
Samsung Electronics
.samsung.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
Samsung Electronics
developer.samsung.com, google.account.samsung.com
Preferences Submitted
You have successfully updated your cookie preferences.