-
Notifications
You must be signed in to change notification settings - Fork 60
Legacy API: TVChannel
Hyojin Kim edited this page Mar 21, 2017
·
3 revisions
For converting TVChannel API of Legacy to TOAST API, please refer to the followings.
If you want more information, please refer to toast.tvchannel
-
Before
/* webapis */ webapis.tv.channel.tune({ major: 7, minor: 1 }, function() {}, function() {}, 0);
/* SEF */ var sef = document.getElementById('sef'); sef.open('Window', '1.0', 'Window'); sef.Execute('SetChannel', 7, 1);
-
After
toast.tvchannel.tune({ major: 7, minor: 1 },{ onsuccess: function() {}, onnosignal: function() {}, onprograminforeceived: function() {} }, function() {});
-
Before
/* webapis */ webapis.tv.channel.tuneUp(function() {}, function() {}, 0, 0);
/* SEF */ sef.Execute('SetChannel_Seek', 3, 0);
-
After
toast.tvchannel.tuneUp({ onsuccess: function() {}, onnosignal: function() {}, onprograminforeceived: function() {} }, function() {});
-
Before
/* webapis */ webapis.tv.channel.tuneDown(function() {}, function() {}, 0, 0);
/* SEF */ sef.Execute('SetChannel_Seek', 4, 0);
-
After
toast.tvchannel.tuneDown({ onsuccess: function() {}, onnosignal: function() {}, onprograminforeceived: function() {} }, function() {}); });
-
Before
/* webapis */ webapis.tv.channel.findChannel(7, 1, function() {}, function() {});
/* SEF */ var channelSize = sef.Execute('GetChannel_Size', 0, 0); for(var i = 0; i < channelSize; i++) { if(sef.Execute('GetChannel_Major', i) == 7 && sef.Execute('GetChannel_Minor', i) == 1) {} }
-
After
toast.tvchannel.findChannel(7, 1, function() {}, function() {});
-
Before
/* webapis */ webapis.tv.channel.getChannelList(function() {}, function() {}, 0, 0, 10);
/* SEF */ var channelList = []; var channelSize = sef.Execute('GetChannel_Size', 0, 0); for(var i = 0; i < channelSize; i++) { channelList[i].major = sef.Execute('GetChannel_Major', i); channelList[i].minor = sef.Execute('GetChannel_Minor', i); }
-
After
toast.tvchannel.getChannelList(function() {}, function() {}, 'ALL', 0, 10);
-
Before
/* webapis */ var channelInfo = webapis.tv.channel.getCurrentChannel(0);
/* SEF */ var channelInfo = {}; channelInfo.major = sef.Execute('GetCurrentChannel_Major'); channelInfo.minor = sef.Execute('GetCurrentChannel_Minor');
-
After
toast.tvchannel.getCurrentChannel(function() {}, function() {});
-
Before
/* webapis */ var channelInfo = webapis.tv.channel.getCurrentChannel(0); webapis.tv.channel.getProgramList(channelInfo, new Date(), function() {}, function() {}, 3);
/* SEF */ var channelInfo = {}; channelInfo.major = sef.Execute('GetCurrentChannel_Major'); channelInfo.minor = sef.Execute('GetCurrentChannel_Minor'); var programList = []; var programSize = sef.Execute('GetProgramList_Size'); for(var i = 0; i < listSize; i++) { programList[i].title = sef.Execute('GetProgram_Title', i); programList[i].start_Time = sef.Execute('GetProgram_StartTime', i); programList[i].duration = sef.Execute('GetProgram_Duration', i); programList[i].end_Time = sef.Execute('GetProgram_EndTime', i); }
-
After
toast.tvchannel.getCurrentChannel(function(channelInfo) { toast.tvchannel.getProgramList(channelInfo, new Date(), function() {}, function() {}, 3); }, function() {});
-
Before
/* webapis */ var programInfo = webapis.tv.channel.getCurrentProgram(0);
/* SEF */ var programInfo = {}; programInfo.major = sef.Execute('GetPresentProgram_Title'); programInfo.minor = sef.Execute('GetPresentProgram_StartTime'); programInfo.minor = sef.Execute('GetPresentProgram_Duration'); programInfo.minor = sef.Execute('GetPresentProgram_EndTime');
-
After
toast.tvchannel.getCurrentProgram(function() {}, function() {});
-
Before
Not supported
-
After
var testFunc = function() {}; toast.tvchannel.addChannelChangeListener(testFunc);
-
Before
Not supported
-
After
var testFunc = function() {}; toast.tvchannel.addChannelChangeListener(testFunc); toast.tvchannel.removeChannelChangeListener(testFunc);
uuuu
Getting Started
Converting Tizen to Toast
- Prepare to convert
- Tizen API: AVPlay
- Tizen API: DrmInfo(Deprecated)
- Tizen API: Application
- Tizen API: TVInputDevice
- Tizen API: TVAudioControl
- Tizen API: TVWindow
- Tizen API: TVChannel
- Tizen API: IME
- Tizen API: ProductInfo
- Tizen API: Network
- How to detect platform
Converting Legacy to Toast
- Prepare to convert
- Legacy API: AVPlay
- Legacy API: TVInfo
- Legacy API: Common
- Legacy API: InputDevice
- Legacy API: AudioControl
- Legacy API: TVWindow
- Legacy API: TVChannel
- Legacy API: IME
- How to detect platform
API Reference
- supported cordova plugin
- toast.Media
- toast.MediaPlugin
- toast.drminfo(Deprecated)
- toast.application
- toast.inputdevice
- toast.tvaudiocontrol
- toast.tvwindow
- toast.tvchannel
- toast.billing
Supported platforms
Sample App
Contribution
Frequently Asked Questions