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.
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.
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).
* New Cloud TV app is not supported after '19.
<!DOCTYPE html> <html> <head lang="en"> <script src="scripts/vendor/msf-2.0.x.min.js"></script> </head> ... </html>
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.
You 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" 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); }); });
It 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
refer to latest CastVideo sample app.
1) setSecurityMode API : This API is only receiver app .
application.setSecurityMode(securityMode)
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'); });
Following are the specific errors to able to receive the message in the onError()