Introduction to Samsung Smart TV SDK
-
date post
17-Oct-2014 -
Category
Technology
-
view
1.918 -
download
0
description
Transcript of Introduction to Samsung Smart TV SDK
What is Samsung SMART TV App?
• Samsung Smart TV applications are web-based small software programs that run on Digital TVs connected to the Internet.
• Applications are installed on TVs via Internet and run on App Engine
Application Manager
App Engine
Operating Principle
Visit www.samsungdforum.com to download the latest SDK
Samsung D Forum
Smart TV SDK evolution
2.x
• Designed for 2011 Devices ( D Model )
• HTML5/CSS3 Support
• Maple Web Engine
3.x
• Designed for 2012 Devices ( E Model )
• Smart Interaction, In-Apps Ads & Convergence Support
• WebKit Web Engine
4.x
• Designed for 2013 Devices ( F Model )
• Smart Interaction 2.0 Support
• Eclipse Based IDE (Linux & Mac OS SDK Available)
http://www.samsungdforum.com
Project Types
Flash 11.1Native Client
SDK 4.5+
Improved HTML5 support
• Support for <video> and <audio> tags
• For formats & support, see link
http://www.samsungdforum.com/Guide/art00066/index.html
<video src=“movie.mp4” width=“320” height=“240”>No HTML5 video tag support.</video>
Improved HTML5 support
• Support for <canvas> tag
http://www.samsungdforum.com/Guide/art00066/index.html
<canvas id=“example” width=“200” height=“200”>This text is displayed if your browser does not support HTML5 canvas.</canvas>
var example = document.getElementById(‘example’);var context = example.getContext(‘2d’);context.fillStyle = “rgd(255,0,0)”;context.fillRect(30,30,50,50);
Web Device APIList of APIs to access low level functionalities of the Smart TV like
• Network capabilities
• TV channels
• Gamepad connectivity
• External Camera support
• Microphone
• Filesystem
• Voice recognition
• MIDI etc<script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js"></script>
Web Device API > Network
• Check network connection
• Set Listeners for changes
http://www.samsungdforum.com/Guide/ref00008/network/dtv_network_module.html
try { webapis.network.getAvailableNetworks(successCB, errorCB);
} catch(err) {alert(err.name);
}
function successCB(networks) {for(var i=0; I < networks.length; i++) {
if(networks[i].isActive() ) {networks[i].setWatchListener(watchCB, errCB);
} }}
Web Device API > TVChannel
• Get ProgramList for current channel
http://www.samsungdforum.com/Guide/ref00008/tvchannel/dtv_tvchannel_module.html
try { var channel = webapis.tv.channel.getCurrentChannel();webapis.tv.channel.getProgramList(channel, webapis.tv.info.getEpochTime(),
successCB, errorCB, 3600 );} catch(err) {
alert(err.name);}
function successCB(programs) {console.log(“program query success”);
}
Single Handed Gestures• You need to include mouse support in
config.xml<mouse>y</mouse>
• Mouse listener like the web.• Create a div in scene1.html<div id="button0">Button</div> <!-- make it as button --><div id="div0“></div> <!-- make it as trial element -->
• Adding listenerdocument.getElementById('div0').addEventListener('mouseover', function(){
document.getElementById('div0').style.backgroundColor = 'lime';}, false);
document.getElementById('div0').addEventListener('mouseout', function(){document.getElementById('div0').style.backgroundColor = 'yellow';}, false);
document.getElementById('div0').addEventListener('click', function(){alert("clicked");}, false);
Double Handed GesturesCheck for support/enabled
if (webapis.recognition.IsRecognitionSupported()) { if (webapis.recognition.IsGestureRecognitionEnabled()) {// perform Recognition related actions here, e.g. subscribe } else { alert("ERROR: Gesture recognition is not enabled"); }
} else { alert("ERROR: Gesture recognition not supported"); }
Subscribe to eventswebapis.recognition.SubscribeExEvent(webapis.recognition.PL_RECOGNITION_TYPE_GESTURE, “returnID", function (evt) { that.handleRecognitionEvent.call(that, evt); });
EVENT_GESTURE_2HAND_ZOOM , EVENT_GESTURE_2HAND_ROTATE etc
Voice Recognition• Embedded Mode
Predefined voice commands.The engine does more of comparison than recognitionDoes NOT require internet.Limited to comparing between 7 items.
• Server Guide ModeFree- form speech.Depends heavily on user’s linguistics and pronunciation.Voice Data is sent to internet to recognize user’s speech.No limits.
Voice Recognition
• Add the voice tag in the config.xml
– <voice>y</voice>
• Include the following library in the index.html
– $MANAGER_WIDGET/Common/webapi/1.0/deviceapis.js– The VR library can be used under the deviceapis.recognition
object
• Set Helpbar!
Voice Recognition
• Not all TV Series have VR feature, it be best to check device compatibility before using the feature.
• Check Device VR Feature Availibility:– deviceapis.recognition.IsRecognitionSupported()
• Check Device VR Feature Enabled or Disabled:– deviceapis.recognition.IsVoiceRecognitionEnabled()
• Check Device Server Guide VR Availibility:– deviceapis.recognition.IsVoiceServerLanguageSupported()
Voice Recognition
• Since the VR runs separately with apps, the apps must subscribe to VR events to use the data from VR.
deviceapis.recognition.SubscribeExEvent(
deviceapis.recognition.PL_RECOGNITION_TYPE_VOICE,
"VoiceEvt",
Main.onVoiceEvent
);
deviceapis.recognition.UnsubscribeExEvent(
deviceapis.recognition.PL_RECOGNITION_TYPE_VOICE,
"VoiceEvt”
);
Built-In Emulator
Virtual Box based. Can test voice and gesture input.
Web Inspector
Breakpoints, stepping and debugging support
Automatic Test Tool
Create input test sequences, schedule screen captures, record events
Important TV vs Emulator
• Performance
• Viewing Distance
• Usage with remote control / Interaction
Thank You