Toast SDK
This guide is for integrating the MediaMelon Player SDK with theToast Cordova Plugin for Smart TV platforms.
The following platforms are supported via the Toast Plugin:
sectv-orsay [Samsung]
sectv-tizen [Samsung]
tv-webos [LG]
For the rest of this guide, the sample media application from the link below is taken as the reference media app.
Github link for media app used for integration :
Please note that all the code changes that need to be made are shown below and indicated by the tags MediaMelon Start and MediaMelon End. Snippets of surrounding code is also provided to act as placeholders and to help you find the right place to insert MediaMelon’s integration code.

Fig 1 describes how the Toast plugin integrates and interacts with the underlying SmartTV platforms (Samsung or LG). Toast is an abstraction layer that makes it simple to write applications for Samsung and LG SmartTVs using a common set of APIs.
The top-most layer in Fig 1 shows the application layer where you can write your apps using Toast’s APIs. In this layer, MediaMelon Player SDK is integrated making it a single integration step irrespective of the underlying SmartTV platform.
In the middle layer, there are platform-specific Toast files which the top-level APIs interact with. Here, certain MediaMelon-specific changes are needed to propagate events and metrics that are not passed-through by Toast.
The final level is the platform level (specific to each SmartTV platform) and this is un-touched by Media Melon’s SmartSight Player SDK integration.
Step-by-Step integration guide.
Github links for working with Cordova Toast Plugin :
GitHub - Samsung/cordova-plugin-toast: Cordova plugin that provides TV Specific functionalities.
Getting- started scripts for automatic/quick setup:
https://github.com/Samsung/cordova-plugin-toast/tree/master/script
2. The following changes/additions are to be made in order to integrate with MediaMelon SmartSight Player SDK:
At the application level:
1) www/index.html
2) js/media.js
At the Toast level
1) toast.js [sectv-tizen platform only]
Application-level changes
→ www/index.html:
Include <mmsmartstreaming-toast-sdk.js> in the index.html. We use a wrapper to load the SDK - so that, if there is an error in loading the SDK, the application will not be affected and playback will continue.
→js/media.js:
Add the toastMMPlugin variable
After the player instance has been created, create a new Plugin object, register, and report player information as shown below:
You can also provide the assetID, assetName, videoID, and custom tags as shown below while setting source information. Please use the mmVideoAssetInfo structure to provide this information.
And then initialize as shown below:
Add the call for reporting error to the Toast Plugin and just before media.play(), call the reportUserInitiatedPlayback()api.
Toast-level changes
→ toast.js:
Please make the following changes toast.js for supporting bitrate change notifications. (Applicable for sectv-tizen platform only.)
Add the Media Events:
Add the respective Media Event handling in Media.mediaEvent() function:
Add the following code in the open: function(successCallback, errorCallback, args) function:
Last updated