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
Manage Your Cookies
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.