{"id":35849,"date":"2016-06-27T15:13:12","date_gmt":"2016-06-27T09:43:12","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=35849"},"modified":"2016-06-27T15:31:13","modified_gmt":"2016-06-27T10:01:13","slug":"guidelines-and-solution-of-top-most-problems-regarding-video-application-in-samsung-smart-tv","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/guidelines-and-solution-of-top-most-problems-regarding-video-application-in-samsung-smart-tv\/","title":{"rendered":"Guidelines and Solution of top most problems regarding Video Application in Samsung Smart TV"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p style=\"text-align: justify;\">Samsung smart Tv is the smart tv which supports the html web application. This blog gives a brief introduction about how to easily <a title=\"VOD Application Development\" href=\"http:\/\/www.tothenew.com\/mobile-smart-tv-application-development\">build the video application<\/a> for Samsung smart tv and the problems that are faced by most of the <a title=\"smart tv app developers\" href=\"http:\/\/www.tothenew.com\/mobile-ios-application-development-services\">developers<\/a> while <a title=\"smart tv apps development\" href=\"http:\/\/www.tothenew.com\/mobile-smart-tv-application-development\">developing the smart tv<\/a> video application.<\/p>\n<p><em>Here I am focusing mainly on the solution of common and mostly occurred problems with smart tv video application.<\/em><\/p>\n<p><span style=\"font-family: 'Liberation Sans', sans-serif;\"><span style=\"font-size: large;\"><b>Prerequisites<\/b><\/span><\/span><\/p>\n<p style=\"text-align: justify;\">In order to develop the application for Samsung smart TV developer are required to have background knowledge about <strong><em>HTML 5, JavaScript and CSS While Angular JS<\/em> <\/strong>is most effective and must have <strong><em>Samsung Smart TV SDK<\/em><\/strong>.<\/p>\n<h3>Basic App Creation<\/h3>\n<ol>\n<ol>\n<li>\n<h4>Config.xml<\/h4>\n<p style=\"text-align: justify;\">Starting from config is the first file in the Samsung application it contains all the configuration such as (App name, Logos, Resolution, Author&#8217;s information,policies etc) it&#8217;s a simple XML file which have some pre-define tags all the tags placed inside the &lt;App&gt; tag. For the video application following tags are mainly required.<\/p>\n<blockquote style=\"margin: 0 0 0 40px; border: none; padding: 0px;\"><p><strong>I.\u00a0<\/strong>&lt;fullApp&gt;y&lt;\/fullApp&gt; App will run in full screen mode.<\/p><\/blockquote>\n<blockquote style=\"margin: 0 0 0 40px; border: none; padding: 0px;\"><p><strong>II.\u00a0<\/strong>&lt;type&gt;user&lt;\/type&gt; Enables the user App feature for testing on a real TV set (Not \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0available for emulator).<\/p><\/blockquote>\n<blockquote style=\"margin: 0 0 0 40px; border: none; padding: 0px;\"><p><strong>III.\u00a0<\/strong>&lt;movie&gt;y&lt;\/movie&gt; Optimizes the App behavior for movie playback<\/p><\/blockquote>\n<\/li>\n<li>\n<h4>index.html<\/h4>\n<\/li>\n<\/ol>\n<\/ol>\n<p style=\"padding-left: 30px;\">This is the html file which runs first in Samsung smart tv application it contains JS files, CSS files, API&#8217;s and Plugins.<\/p>\n<p style=\"padding-left: 30px;\">&lt;!&#8211; Dummy anchor to receive key events&#8211;&gt;<\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">&lt;a href='javascript:void(0);' id='anchor'onkeydown='Main.keyDown();'&gt;&lt;\/a&gt;<\/span><\/pre>\n<h5><em>A.\u00a0<\/em>\u00a0<strong>Common API&#8217;s &#8211;<\/strong><\/h5>\n<pre style=\"padding-left: 30px;\"><span style=\"color: #3366ff;\"><span style=\"color: #000000;\">&lt;!-- Common widget API --&gt;<\/span><\/span><span style=\"color: #3366ff;\">\r\n&lt;script type='text\/javascript' language='javascript' src='$MANAGER_WIDGET\/Common\/API\/Widget.js'&gt;&lt;\/script&gt; \r\n&lt;script type='text\/javascript' language='javascript' src='$MANAGER_WIDGET\/Common\/API\/TVKeyValue.js'&gt;&lt;\/script&gt;\r\n&lt;script type=\"text\/javascript\" language=\"javascript\" src=\"$MANAGER_WIDGET\/Common\/API\/Plugin.js\"&gt;&lt;\/script&gt; \r\n<\/span><\/pre>\n<p>The TVKey Value is used for accessing and handling the tv RC keys, widget is mainly used to control the navigation of screen and\u00a0Plugin api is used mainly for handle the screen saver .<\/p>\n<p>B. <strong>Plugins &#8211;<\/strong><\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #000000;\">&lt;!-- Plugin for NetWorkConnection--&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;object id=\"pluginNetworkConnection\" classid=\"clsid:SAMSUNG-INFOLINK-SEF\" <\/span>\r\n<span style=\"color: #3366ff;\">style=\"width: 0px; height: 0px; display: none;\"&gt;&lt;\/object&gt;<\/span>\r\n\r\n<span style=\"color: #000000;\">&lt;!-- Plugins For video --&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;object id=\"pluginPlayer\" border=0 classid=\"clsid:SAMSUNG-INFOLINK-PLAYER\"&gt;&lt;\/object&gt; <\/span>\r\n<span style=\"color: #3366ff;\">&lt;object id=\"pluginObjectTVMW\" border=0 classid=\"clsid:SAMSUNG-INFOLINK-TVMW\"&gt;\r\n&lt;\/object&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;object id=\"pluginObjectNNavi\" border=0 classid=\"clsid:SAMSUNG-INFOLINK-NNAV\"&gt;&lt;\/object&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;object id=\"pluginScreen\" classid=\"clsid:SAMSUNG-INFOLINK-SCREEN\"&gt;&lt;\/object&gt;<\/span>\r\n\r\n<span style=\"color: #000000;\">&lt;!-- Plugins for Audio --&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;object id=\"pluginAudio\" border=0 classid=\"clsid:SAMSUNG-INFOLINK-AUDIO\"&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;\/object&gt;<\/span> \r\n\r\n<\/pre>\n<p><em>Plugin Player<\/em> provides access to video playback functions of the TV and it also gets a temporary reference to the TV Middle ware plugin (<em><span style=\"color: #000000;\">pluginObjectTVMW<\/span><\/em>) to switch the display to show video from the player plugin, instead of the TV receiver. Without doing this, video playback will not work correctly while <em>pluginScreen<\/em> help to display the video content to the TV.<\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #000000;\">Structure of Index.html <\/span>\r\n<span style=\"color: #3366ff;\">&lt;!DOCTYPE html&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;html&gt;<\/span>\r\n\r\n<span style=\"color: #3366ff;\">&lt;head&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\"&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;title&gt;Video App&lt;\/title&gt;<\/span>\r\n\r\n<span style=\"color: #3366ff;\">&lt;!-- include Common widget API here --&gt;<\/span><span style=\"color: #3366ff;\">\r\n&lt;!-- include plugins here--&gt;\r\n<\/span>\r\n<span style=\"color: #3366ff;\">&lt;!-- App code --&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;script language=\"javascript\" type=\"text\/javascript\" src=\"Javascript\/Main.js\"&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;\/script&gt;<\/span>\r\n\r\n<span style=\"color: #3366ff;\">&lt;\/head&gt;<\/span>\r\n\r\n<span style=\"color: #3366ff;\">&lt;body onload=\"Main.onLoad();\" onunload=\"Main.onUnload();\"&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;a href='javascript:void(0);' id='anchor' onkeydown='Main.keyDown();'&gt;&lt;\/a&gt;<\/span>\r\n<span style=\"color: #3366ff;\">&lt;\/body&gt;<\/span>\r\n\r\n<span style=\"color: #3366ff;\">&lt;\/html&gt;<\/span><\/pre>\n<pre style=\"padding: 30px;\"><span style=\"color: #000000;\"> Example of Main.JS to Control the Player-<\/span>\r\n\r\n<span style=\"color: #3366ff;\">var AppAPI = new Common.API.App();<\/span>\r\n<span style=\"color: #3366ff;\">var tvKey = new Common.API.TVKeyValue();<\/span>\r\n<span style=\"color: #3366ff;\">var plugin = document.getElementById(\"pluginPlayer\");<\/span>\r\n<span style=\"color: #3366ff;\">var Main ={ }<\/span>\r\n\r\n<span style=\"color: #3366ff;\">Main.onLoad = function(){<\/span>\r\n<span style=\"color: #3366ff;\">alert(\"Main.onLoad()\");<\/span>\r\n<span style=\"color: #3366ff;\">this.enableKeys();<\/span>\r\n<span style=\"color: #3366ff;\">AppAPI.sendReadyEvent();<\/span>\r\n\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n\r\n<span style=\"color: #3366ff;\">Main.onUnload = function(){<\/span>\r\n<span style=\"color: #3366ff;\">alert(\"Main.onUnload()\");<\/span>\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n\r\n<span style=\"color: #3366ff;\">Main.enableKeys = function(){<\/span>\r\n<span style=\"color: #3366ff;\">document.getElementById(\"anchor\").focus();<\/span>\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n\r\n<span style=\"color: #3366ff;\">Main.keyDown = function(){<\/span>\r\n<span style=\"color: #3366ff;\">var keyCode = event.keyCode;<\/span>\r\n<span style=\"color: #3366ff;\">alert(\"Key pressed: \" + keyCode);<\/span>\r\n<span style=\"color: #3366ff;\">switch(keyCode){<\/span>\r\n<span style=\"color: #3366ff;\">case tvKey.KEY_PLAY:<\/span>\r\n<span style=\"color: #3366ff;\">alert(\"PLAY\");<\/span>\r\n<span style=\"color: #3366ff;\">plugin.Play(\u201cYour_Video_url\u201d);<\/span>\r\n<span style=\"color: #3366ff;\">break;<\/span>\r\n<span style=\"color: #3366ff;\">default:<\/span>\r\n<span style=\"color: #3366ff;\">alert(\"Unhandled key\");<\/span>\r\n<span style=\"color: #3366ff;\">break;<\/span>\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n<span style=\"color: #3366ff;\">}\u00a0<\/span>\r\n\r\n<span style=\"color: #000000;\">Where Main is the Js file of yours and keyDown is the method of Main.js<\/span><\/pre>\n<p><strong>There are some major Problem that occurred and must be handled for video application &#8211;<\/strong><\/p>\n<p>Here is the some problems and their solutions &#8211;<\/p>\n<ol>\n<li><strong>Must handle the network connection checking if internet is disconnected while playing video, Auto play the video resuming from the same point when the internet is connected. \u00a0 \u00a0 <\/strong><strong><br \/>\nSolution &#8211;<\/strong><\/p>\n<p style=\"padding-left: 30px;\">set the callback \u00a0OnNetworkDisconnected for network error to the player plugin and get the callback when internet disconnected and for resume time set\u00a0the call OnCurrentPlayTime for current time.<\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">plugin.OnNetworkDisconnected='Player.onNetworkDisconnected';<\/span>\r\n<span style=\"color: #3366ff;\">plugin.OnCurrentPlayTime = 'Player.setCurTime';<\/span><\/pre>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">\/\/Callback for Network error \r\nPlayer.onNetworkDisconnected = function() {<\/span>\r\n<span style=\"color: #3366ff;\">\/\/Periodically check for internet connection<\/span>\r\n<span style=\"color: #3366ff;\">Player.checkNetworkConnection();<\/span>\r\n<span style=\"color: #3366ff;\">};\r\n\r\n\/\/Callback for Resume time \r\nPlayer.setCurTime = function(time) {\r\nvar resumeTime = parseInt(time \/ 1000);<\/span>\r\n<span style=\"color: #3366ff;\">};<\/span><\/pre>\n<p style=\"padding-left: 30px;\">This method is used for checking the internet connection is available or not using pluginNetworkConnection plugin.<\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">var checkGetway = function(success) {<\/span>\r\n<span style=\"color: #3366ff;\">var plugin = document.getElementById(\"pluginNetworkConnection\");<\/span>\r\n\r\n<span style=\"color: #3366ff;\">plugin.style.display = \"block\";<\/span>\r\n\r\n<span style=\"color: #3366ff;\">plugin.Open('Network', '1.001', 'Network');<\/span>\r\n\r\n<span style=\"color: #3366ff;\">var cType = plugin.Execute(\"GetActiveType\");<\/span>\r\n\r\n<span style=\"color: #3366ff;\">\/\/ cType === 1 : active interface is WIRED - 0 : active interface is<\/span>\r\n\r\n<span style=\"color: #3366ff;\">\/\/ WIRELESS, -1 -disconnected<\/span>\r\n\r\n<span style=\"color: #3366ff;\">var phyConnection = plugin.Execute(\"CheckPhysicalConnection\", cType);<\/span>\r\n\r\n<span style=\"color: #3366ff;\">\/\/ CheckPhysicalConnection - phyConnection ==0 not connected<\/span>\r\n\r\n<span style=\"color: #3366ff;\">showTagLog(\"cType \", cType);<\/span>\r\n\r\n<span style=\"color: #3366ff;\">showTagLog(\"phyConnection \", phyConnection);<\/span>\r\n\r\n<span style=\"color: #3366ff;\">\/\/ showDefaultToast(\"phyConnection \" + phyConnection + \"cType \" + cType);<\/span>\r\n\r\n<span style=\"color: #3366ff;\">if (phyConnection == 0) {<\/span>\r\n\r\n<span style=\"color: #3366ff;\">showLog(\"disconnected\");<\/span>\r\n\r\n<span style=\"color: #3366ff;\">isOnline = false;<\/span>\r\n\r\n<span style=\"color: #3366ff;\">success(isOnline);<\/span>\r\n\r\n<span style=\"color: #3366ff;\">} else {<\/span>\r\n\r\n<span style=\"color: #3366ff;\">isOnline = true;<\/span>\r\n\r\n<span style=\"color: #3366ff;\">showLog(\"Connected\");<\/span>\r\n\r\n<span style=\"color: #3366ff;\">success(isOnline);<\/span>\r\n\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n\r\n<span style=\"color: #3366ff;\">plugin.style.display = \"none\";<\/span>\r\n\r\n<span style=\"color: #3366ff;\">};<\/span>\r\n<\/pre>\n<p style=\"padding-left: 30px;\">This method is used for periodically checking the internet connection and when internet is connected just stop the checking and play the video again.<\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">Player.checkNetworkConnection = function() {<\/span>\r\n<span style=\"color: #3366ff;\">\/\/showNetworkError<\/span>\r\n\r\n<span style=\"color: #3366ff;\">interval = setInterval(function() {<\/span>\r\n\r\n<span style=\"color: #3366ff;\">\/\/checkConnection<\/span>\r\n\r\n<span style=\"color: #3366ff;\">checkGetway(function(online) {<\/span>\r\n\r\n<span style=\"color: #3366ff;\">if (online) {<\/span>\r\n\r\n<span style=\"color: #3366ff;\">\/\/hide NetworkError<\/span>\r\n\r\n<span style=\"color: #3366ff;\">Player.isNetworkError = false;<\/span>\r\n\r\n<span style=\"color: #3366ff;\">clearInterval(interval);<\/span>\r\n\r\n<span style=\"color: #3366ff;\">\/\/Now Replay the Video. With resume time you can get \/\/ the resume time from Player.setCurTime method for this<\/span>\r\n\r\n<span style=\"color: #3366ff;\">} else {<\/span>\r\n\r\n<span style=\"color: #3366ff;\">\/\/showNetworkError<\/span>\r\n\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n\r\n<span style=\"color: #3366ff;\">});<\/span>\r\n\r\n<span style=\"color: #3366ff;\">}, 3000);<\/span>\r\n\r\n<span style=\"color: #3366ff;\">};<\/span><\/pre>\n<p>&nbsp;<\/li>\n<li><strong><strong>If Video is completed you must be able to\u00a0navigate to the previous screen automatically (In Case the Player screen is not the only screen).<\/strong><\/strong><strong><strong><br \/>\nSolution &#8211;\u00a0<\/strong><\/strong>Player plugin provide the OnRenderingComplete callback which indicate the completion of the video so just set the callback to handle this.<\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">plugin.OnRenderingComplete = 'Player.onRenderingComplete';<\/span>\r\n<span style=\"color: #3366ff;\">Player.onRenderingComplete = function() {\r\nplugin.Stop();\r\nwidgetAPI.blockNavigation(event);\r\nwindow.history.go(-1);\r\n};\r\n<\/span><\/pre>\n<\/li>\n<li><strong><strong><strong>After a definite period of time during video playback, the screen saver is appeared so, screen saver must be off before Video playback.<br \/>\n<\/strong><\/strong><\/strong><strong><br \/>\nSolution &#8211;<\/strong><\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">var PLUGIN = new Common.API.Plugin();\r\n\/\/PLUGIN.setOnScreenSaver();\r\n\/\/PLUGIN.setOnScreenSaver(1200); \/\/ user set Time.\r\nPLUGIN.setOffScreenSaver(); \/\/ off screen saver<\/span><\/pre>\n<\/li>\n<li><strong>Check the System volume if its mute show the mute volume in your application and if the volume is mute pressing unmute\/mute or volume -\/+ must release the mute status.<\/strong><br \/>\n<strong style=\"line-height: 1.71429; font-style: italic; font-size: 1rem;\"><strong style=\"line-height: 1.71429; font-style: italic; font-size: 1rem;\"><br \/>\nSolution &#8211;\u00a0Get the Audio plugin and get the current mute status if status is 1 so mute the video player.<\/strong><\/strong><\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">audioplugin = document.getElementById(\"pluginAudio\");\r\nif (Main.getUserMute() == 1) {\r\nMain.setMuteMode();\r\n} else {\r\nMain.noMuteMode();\r\n}\r\nMain.getUserMute = function() {\r\nreturn audioplugin.GetUserMute();\r\n};\r\n\r\nMain.setMuteMode = function() {\r\naudioplugin.SetUserMute(true);\r\n};\r\n\r\nMain.noMuteMode = function() {\r\naudioplugin.SetUserMute(false);\r\n};<\/span><\/pre>\n<\/li>\n<li><strong><strong>Player controller automatically hide and show on any RC keys press.<br \/>\nSolution &#8211;<\/strong><\/strong><\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">var clicked = false;<\/span>\r\n\/\/<span style=\"color: #000000;\">in Main.onLoad call autoHideController to hide<\/span> \r\n<span style=\"color: #3366ff;\">var autoHideController = function() {<\/span>\r\n<span style=\"color: #3366ff;\"> if (clicked) {<\/span>\r\n<span style=\"color: #3366ff;\"> resetClock();<\/span>\r\n<span style=\"color: #3366ff;\"> } else {<\/span>\r\n<span style=\"color: #3366ff;\"> startClock();<\/span>\r\n<span style=\"color: #3366ff;\"> }<\/span>\r\n<span style=\"color: #3366ff;\"> };<\/span>\r\n\r\n<span style=\"color: #3366ff;\">function startClock() {<\/span>\r\n<span style=\"color: #3366ff;\"> if (clicked === false) {<\/span>\r\n<span style=\"color: #3366ff;\"> \/\/ write your code here to show your Controller <\/span>\r\n<span style=\"color: #3366ff;\"> clock = setInterval(\"stopWatch()\", 1000);<\/span>\r\n<span style=\"color: #3366ff;\"> clicked = true;<\/span>\r\n<span style=\"color: #3366ff;\"> } else if (clicked === true) {<\/span>\r\n<span style=\"color: #3366ff;\"> }<\/span>\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n\r\n<span style=\"color: #3366ff;\">function stopWatch() {<\/span>\r\n<span style=\"color: #3366ff;\"> sec++;<\/span>\r\n<span style=\"color: #3366ff;\"> if (sec &gt;= 2) {<\/span>\r\n<span style=\"color: #3366ff;\"> \/\/ Write your code to hide your Controller<\/span>\r\n<span style=\"color: #3366ff;\"> stopClock();<\/span>\r\n<span style=\"color: #3366ff;\"> }<\/span>\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n\r\n<span style=\"color: #3366ff;\">function stopClock() {<\/span>\r\n<span style=\"color: #3366ff;\"> if (clock) {<\/span>\r\n<span style=\"color: #3366ff;\"> window.clearInterval(clock);<\/span>\r\n<span style=\"color: #3366ff;\"> }<\/span>\r\n<span style=\"color: #3366ff;\"> sec = 0;<\/span>\r\n<span style=\"color: #3366ff;\"> clicked = false;<\/span>\r\n<span style=\"color: #3366ff;\">}<\/span>\r\n\r\n<span style=\"color: #3366ff;\">function resetClock() {<\/span>\r\n<span style=\"color: #3366ff;\"> stopClock();<\/span>\r\n<span style=\"color: #3366ff;\"> startClock();<\/span>\r\n<span style=\"color: #3366ff;\">}<\/span><\/pre>\n<\/li>\n<li><strong>Check the network connection before going to play screen. if internet is not available, just show the error not navigate to the play screen.<br \/>\nSolution &#8211;<\/strong><\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">checkGetway(function(online) {                                               if (online) { \/\/ Go to Player screen<\/span>\r\n<span style=\"color: #3366ff;\">} else {<\/span>\r\n<span style=\"color: #3366ff;\">\/\/show Network Error<\/span>\r\n<span style=\"color: #3366ff;\">\/\/ if only screen exit form application or show the dialog to exit .<\/span>\r\n<span style=\"color: #3366ff;\">}<\/span><\/pre>\n<p>&nbsp;<\/li>\n<li><strong>Check the network connection of play screen before loading the video. if internet is not available, navigate to the previous screen.<br \/>\nSolution &#8211;<\/strong><\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">checkGetway(function(online) {\r\nif (online) {\r\n\/\/ Initlize the player plugin\r\n} else {\r\n\/\/ Go back to previous screen if available .\r\nwindow.history.go(-1);\r\n}<\/span><\/pre>\n<\/li>\n<li><strong><strong>Show the Loading display to avoid the black screen of player while\u00a0preparing. \u00a0<\/strong><\/strong><strong><br \/>\nSolution &#8211;<\/strong><br \/>\nMake your Element how your application required or how you want to design and make the id of that tag like loadingImage.In the Starting call the method to show the loading Main.showLoadingDialog();<span style=\"color: #3366ff;\"><strong>To hide the loading add the callback to the player plugin for OnStreamInfoReady to get the call back and hide the loading. \u00a0<\/strong><\/span><\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">plugin.OnStreamInfoReady = 'Player.setTotalTime';\r\nPlayer.setTotalTime = function() {\r\nif (this.startCallback) {\r\nthis.startCallback();\r\n}\r\nPlayer.startCallback = function() {\r\nMain.hideLoadingDialog();\r\n}\r\n};\r\nMain.showLoadingDialog = function() {\r\nvar elementLoadingImage = document.getElementById(\"loadingImage\");\r\nelementLoadingImage.style.display = 'block';\r\n};\r\nMain.hideLoadingDialog = function() {\r\nvar elementLoadingImage = document.getElementById(\"loadingImage\");\r\nelementLoadingImage.style.display = 'none';\r\n};<\/span><\/pre>\n<\/li>\n<li><strong>\u00a0Show the buffering display, while the Video is buffering. Handling of Network Error if occurs.<br \/>\nSolution &#8211;\u00a0<\/strong>For showing the Buffering dialog need to add few callback to the player plugin<\/p>\n<pre style=\"padding: 30px;\"><span style=\"color: #3366ff;\">plugin.OnBufferingStart = 'Player.onBufferingStart';\r\nplugin.OnBufferingProgress = 'Player.onBufferingProgress';\r\nplugin.OnBufferingComplete = 'Player.onBufferingComplete';\r\nplugin.OnNetworkDisconnected='Player.onNetworkDisconnected';<\/span>\r\n<span style=\"color: #3366ff;\">Player.onBufferingStart = function() {\r\n\/\/ showBuffering\r\n};\r\nPlayer.onBufferingProgress = function(percent) {\r\n\/\/ show \"Buffering percent\r\n};\r\nPlayer.onBufferingComplete = function() {\r\n\/\/ hideBuffering\r\n};\r\nPlayer.onNetworkDisconnected = function()\r\n\/\/ Show Network Error!<\/span>\r\n<span style=\"color: #3366ff;\">};<\/span><\/pre>\n<\/li>\n<li><strong>Problem to Play the HSL (.m3u8) Videos.<br \/>\nSolution &#8211;<\/strong><\/li>\n<\/ol>\n<p style=\"padding-left: 30px;\"><span style=\"color: #3366ff;\">Change the .m3u8 url by adding the &#8220;|COMPONENT=HLS&#8221; to the end of Url to make it playable in samsung smart tv.<\/span><\/p>\n<pre style=\"padding: 30px;\"><strong><span style=\"color: #3366ff;\">var getModifyUrl = function(url)\r\n{ \r\nvar newurl = url; \r\nif (newurl.indexOf('m3u8') &gt;= 0) \r\n{  \r\nnewurl = newurl + \"|COMPONENT=HLS\";\r\n} \r\nreturn newurl;\r\n};<\/span><\/strong><\/pre>\n<h2>Conclusion<\/h2>\n<p>Using the above solutions suggested for common challenges faced, will ease your development to achieve the complete functionality with good quality.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Samsung smart Tv is the smart tv which supports the html web application. This blog gives a brief introduction about how to easily build the video application for Samsung smart tv and the problems that are faced by most of the developers while developing the smart tv video application. Here I am focusing mainly [&hellip;]<\/p>\n","protected":false},"author":864,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":11},"categories":[3477,1],"tags":[3520,3521,3519],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/35849"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/864"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=35849"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/35849\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=35849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=35849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=35849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}