multimedia q&a the following questions are related to implementing multimedia playback features faq search form search q1 how do i implement subtitles? 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 #subtitle #video element #avplay api #caption tv, htv q2 can i implement video playback using the html5 "video" element? yes for implementation information, see using video elements alternatively, you can also implement video playback using the avplay api #html #video element tv, htv q3 how do i implement media playback with the avplay api? for information about implementing media playback with the avplay api, see using avplay the avplay api allows you to play media content with features not supported in html5, such as adaptive streaming, additional subtitle formats, and 4k 8k uhd video #avplay api #adaptive streaming #subtitle #4k #uhd tv, htv q4 how do i handle multitasking for media playback using avplay? 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 ; } } ; for more information, see multitasking #avplay api #multitasking #suspend #restore tv, htv q5 do samsung tvs support multiple audio or subtitle tracks? yes, you can implement multiple audio tracks and multiple subtitle tracks using the avplay api 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 #subtitle #audio track #multiple tracks #avplay api #video element #caption tv, htv q6 can i play media using a "video" element and an "avplay" instance at the same time? no a video element and an avplay instance cannot play content simultaneously #video element #avplay api tv, htv q7 how do i check whether the tv supports 4k uhd video? to check whether the tv supports 4k uhd resolution, use the isudpanelsupported method of the productinfo api #uhd #4k #screen resolution #productinfo api tv, htv q8 how do i retrieve the current playback time using the avplay api? to retrieve the current playback time, use the getcurrenttime method it returns the playback time in milliseconds #avplay api #playback time #getcurrenttime #timestamp tv, htv q9 can i override the screen aspect ratio during media playback? 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 #aspect ratio #fullscreen #letterbox #override #display mode tv, htv q10 does the avplay api support rotating the video image? no the avplay api plays the video content as delivered it does not support rotating or mirroring the video image #avplay api #rotate #mirror #video image #flip #reverse tv, htv q11 can i disable the captioning feature from within my application? 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 #caption #subtitle #tv setting tv, htv q12 can i implement switching the audio mode from within the application? no, switching the tv audio mode is not supported by the api the user must select the audio mode from the tv menu #audio mode tv q13 can i use the "autoplay" and "loop" attributes in html "video" elements? yes, the autoplay and loop attributes for the html video element are supported on samsung smart tvs #html #video element #autoplay #loop tv, htv q14 is the html5 "getvideoplaybackquality " method supported? no, the getvideoplaybackquality method of the htmlvideoelement interface is not supported #html5 #html video element #getvideoplaybackquality #playback quality tv, htv q15 is a backward jump implementation required? 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 #jump #backward #rewind #user experience #ux #application ui description tv, htv q16 can i create a link that opens streaming content in another application? 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 #embedding #html #embedded content #application launch tv, htv q17 why are my html "video" elements not playing 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 #video element #video format tv, htv q18 how do i handle avplay errors? 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 #avplay api #error code #onerror tv, htv q19 when using the avplay api, why are subtitles not working? 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 + ''; } for more information on selecting a subtitle track, see switching subtitle tracks #avplay api #subtitle track #caption tv, htv q20 when i play media with the avplay api, there is no video, only audio how do i fix this? 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 #avplay api #display area #4k #uhd #no video tv, htv q21 why does closed captioning text appear extra wide on the screen? captioning text is rendered with fixed-width monospace fonts, which can appear wider than variable-width proportional fonts #caption #subtitle #font #text #font width tv, htv q22 on a tv with closed captioning enabled, why are the captions missing from the picture in picture pip window within my application? 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 #captions #subtitles #picture in picture #pip #tv broadcast #tvwindow api tv, htv q23 why am i unable to use the "seekto " method to move to the 0 millisecond timestamp? 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 #seek #jump #avplay api #seekto tv, htv q24 when starting media playback, i get the "player_error_connection_failed" error how do i fix this? 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 #network connection #error #url #security certificate #security setting #server tv, htv q25 when i start playing a video with multiple audio tracks, why is there no audio? 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 #multiple audio tracks #setselecttrack #smooth streaming #avplay api tv, htv q26 when i use the "setvolume " method to control the volume level, the volume changes but no volume ui is shown is this intentional? 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 #volume level #volume ui #tvaudiocontrol api tv, htv q27 video playback is stuck on a black screen how do i fix this? poor network connectivity can cause media to load slowly to inform the user that content is still loading, implement a loading screen #network connectivity #black screen #loading screen tv, htv