Samsung Smart TV Application: Playing 3D Media

3D Media become well-known feature on the latest TV products. It will give unique user experience for the users to show lively images right in front of their eyes. Samsung Smart TV bring possibilities to developers to create an application with 3D Media Playback feature. The requirements is just right 3D media format and Samsung Smart TV SDK and of course the real Smart TV device to try the result.

The common format of 3D media is side-by-side images or videos. It looks like the photo below…

Images from hdtvexpert.com

Let’s start to the source code, i will assume that you’ve already know how to develop Smart TV Application.

First, we need some SEF Plugin in the index.html to interact with TV native driver.

<object id="pluginObjectScreen" classid="clsid:SAMSUNG-INFOLINK-SCREEN"></object>
<object id="pluginObjectPlayer" classid="clsid:SAMSUNG-INFOLINK-PLAYER"></object>

Next, let’s do some magic with javascript codes. Just place it in everywhere you want. I will write some important code snippets.

Getting the SEF Plugin Reference

Main.Screen = null;
Main.Player = null;

Main.onLoad = function()
{
	// Enable key event processing
	this.enableKeys();
	widgetAPI.sendReadyEvent();
	
	setTimeout(function(){
		Main.Screen = document.getElementById('pluginObjectScreen');
		Main.Player = document.getElementById('pluginObjectPlayer');
	}, 1000);	
};

Checking the 3D Support of Device

var support3D = Main.Screen.Flag3DEffectSupport();

Playing the 3D Media Player

Main.Player.Stop();
Main.Player.InitPlayer('http://www.hdtvexpert.com/wp-content/uploads/2010/11/Side-by-side-Example-MR.jpg');			
Main.Player.SetDisplayArea(0, 0, 960, 540);			
Main.Player.SetPlayerProperty(2, "3", 1);
Main.Player.StartPlayback();

Enabling the 3D Viewing Mode

Main.Screen.Set3DEffectMode(2);

Now try it on your real device because emulator won’t work for this

Viewed : 1637 times

3 Thoughts on “Samsung Smart TV Application: Playing 3D Media

  1. JOSUE on 27 January 2014 at 13:56 said:

    Hi
    Do you know a way to implement the 3D enabled on INFOLINK_SEF … actually Im using it
     <objectid=’pluginPlayer’border=0classid=’clsid:SAMSUNG-INFOLINK-SEF’style=’position:absolute;left:0px;top:0px;width:512px;height:288px’></object>
    as my player due subtitles implementation.. 

  2. JOSUE on 27 January 2014 at 14:01 said:

    hi again, I implement it and is working.. thanks a lot

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation