You can build your own receiver application with Smart View SDK. Or, you can utilize the default application that is provided by Samsung. The Smart View SDK provides various options where you can take one that best suits for your needs.
TV Apps are created as standard HTML5 apps. You can create your TV app using the TizenTV IDE, or any editor that you choose.
Installed TV App
You can add Smart View feature on existing Samsung Smart TV apps. Using Smart View SDK, the sender application can install and launch your TV app with its app ID.
Downloadable and launchable with a TV remote
Direct access on Smart Hub
Full access to Tizen or Samsung Legacy Platform APIs
Put TV in development mode and register dev machine
Create a target on IDE that points to the TV (Go to the Connection explorer panel -> Remote device manager icon and enter the the TV IP address (The TV and the dev machine has to be in the same network).
Run the project as a Tizen Web application (right click project -> Run as -> Tizen Web application).
You can utilize the default application provided by Samsung as a receiver. Using Smart View SDK, the sender application can send a content URL to play it with the DMP(Default Media Player).
Your TV app is created in HTML5. When your TV app loads, the first thing you'll want to do is initialize the Smart View SDK, so that your TV app can receive messages from a mobile application.
Unlike a mobile application, you don't need to "discover" TVs from your TV application. You "are" the TV application, so all you need to do is get a reference to the current or "local" device.
NoteYou typically should do this initialization as soon as your TV application loads. For example, do the initialization in the window.onload event. You TV app will not receive messages from your mobile application until this initialization is complete. Also, your mobile application will not receive the "onConnect" event until this is complete.
The basic workflow is:
Get a reference to the "local" service
Connect to a communication "channel"
Add Event Listeners
// Get a reference to the local "service"
window.msf.local(function(err, service) {
if (err) {
console.log('msf.local error: ' + err);
return;
}
// Create a reference to a communication "channel"
var channel = service.channel('com.yourcompany.yourapp');
// Connect to the channel
channel.connect(function (err) {
if(err) return console.error(err);
console.log('You are connected');
});
// Add a message listener. This is where you will receive messages from mobile devices
channel.on('fireMissile', function(msg, from){
console.log(from.attributes.name + ' says, ' + msg);
});
// Add a listener for when another client connects, such as a mobile device
channel.on('clientConnect', function(client){
// Send the new client a message
channel.publish('say', 'Hello '+client.attributes.name, client.id);
});
});
Enhanced Features
TLS (make secure connection)
NoteIt need to update mobile library to use TLS feature
Android 2.3.7 higher
iOS 2.3.8 higher
JS 2.3.3 higher
SmartviewSDK can make secure connection between sender and receiver through wss & http
1) setSecurityMode API : This API is only receiver app .
application.setSecurityMode(securityMode)
Set security mode status to for web socket connection or rest API
Parameters:
securityMode - security mode status to set
2) Sample Code
Tizen Web APP(Receiver app)
var channel = service.channel(mChannel);
channel.setSecurityMode(true);
channel.connect({name: 'TV'}, function (err) {
if(err) {
return console.log(err);
}
log('channel.connect');
});
Error Code
Following are the specific errors to able to receive the message in the onError()
Code
Description
401
UNAUTHORIZED Error
404
NOT_FOUND Error
500
Internal Server Error
SAMSUNG and Cookies
Samsung Electronics, and its partners, use cookies and similar technologies
(collectively “technologies”) to store and access information on your device. Some of
these technologies are technically essential to provide you with a secure,
well-functioning and reliable website. We would also like to set
optional/non-essential technologies to give you the best user experience. Optional
technologies make it possible to measure the audience of our website, to display
personalized advertising on third-party sites based on your profile, to track your
location, to carry out targeted marketing campaigns and to personalize the content of
our website depending on your usage. Through these technologies, we will collect
information such as your interaction with our website, your preferences and your
browsing habits.
If you are happy for technologies to be used for these purposes, click on "Accept All"
to accept all of the technologies. Alternatively, you may click "Continue without
accepting" to refuse all non-essential technologies. You can also make a choice by
category by clicking "Configure". You can withdraw your consent and modify your
choices at any time by clicking on the "Cookie Preferences" button located at the
bottom of our website. Further information is also available in
our Cookie Policy and our
Privacy Policy.
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
.samsungdeveloperconference.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
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.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
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.