Skip to content

Commit

Permalink
add mag DUID # MAC functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Chinin committed Feb 28, 2014
1 parent 28b1926 commit 3cb7262
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 222 deletions.
194 changes: 90 additions & 104 deletions dist/smartbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3140,18 +3140,7 @@ SB.createPlatform('browser', {
this.DUID = 'FIREFOXISBEST';
}
return this.DUID;
},

volumeUp: function () {
},

volumeDown: function () {
},

getVolume: function () {
}


});

(function ($) {
Expand Down Expand Up @@ -3479,120 +3468,117 @@ SB.readyForPlatform('mag', function () {

(function () {

var stb;
/**
* Mag set top box platform description
*/
SB.createPlatform('mag', {
keys: {
RIGHT: 39,
LEFT: 37,
DOWN: 40,
UP: 38,
RETURN: 8,
EXIT: 27,
TOOLS: 122,
FF: 70,
RW: 66,
NEXT: 34,
PREV: 33,
ENTER: 13,
RED: 112,
GREEN: 113,
YELLOW: 114,
BLUE: 115,
CH_UP: 9,
CH_DOWN: 9,
N0: 48,
N1: 49,
N2: 50,
N3: 51,
N4: 52,
N5: 53,
N6: 54,
N7: 55,
N8: 56,
N9: 57,
PRECH: 116,
POWER: 85,
//SMART: 36,
PLAY: 82,
STOP: 83,
//PAUSE: 99,
//SUBT: 76,
INFO: 89
//REC: 82
},

onDetect: function () {

var isStandBy = false;
var stb;
/**
* Mag set top box platform description
*/
SB.createPlatform('mag', {
keys: {
RIGHT: 39,
LEFT: 37,
DOWN: 40,
UP: 38,
RETURN: 8,
EXIT: 27,
TOOLS: 122,
FF: 70,
RW: 66,
NEXT: 34,
PREV: 33,
ENTER: 13,
RED: 112,
GREEN: 113,
YELLOW: 114,
BLUE: 115,
CH_UP: 9,
CH_DOWN: 9,
N0: 48,
N1: 49,
N2: 50,
N3: 51,
N4: 52,
N5: 53,
N6: 54,
N7: 55,
N8: 56,
N9: 57,
PRECH: 116,
POWER: 85,
//SMART: 36,
PLAY: 82,
STOP: 83,
//PAUSE: 99,
//SUBT: 76,
INFO: 89
//REC: 82
},

stb = window.gSTB;
onDetect: function () {

window.moveTo(0, 0);
window.resizeTo(1280, 720);
var isStandBy = false;

SB(function () {
var $body = $(document.body);
$body.on('nav_key:power', function () {
var eventName = 'standby_';
isStandBy = !isStandBy;
stb = window.gSTB;

eventName += isStandBy ? 'set' : 'unset';
stb.StandBy(isStandBy);
// prohibition of keyboard showing on click keyboard button
stb.EnableVKButton(false);

// TODO: trigger events on SB
$$log('trigger standby event ' + eventName, 'standby');
$body.trigger(eventName);
});
});
window.moveTo(0, 0);
window.resizeTo(1280, 720);

SB(function () {
var $body = $(document.body);
$body.on('nav_key:power', function () {
var eventName = 'standby_';
isStandBy = !isStandBy;

window.localStorage = {
setItem: function (name, data) {
eventName += isStandBy ? 'set' : 'unset';
stb.StandBy(isStandBy);

},
clear: function () {

},
getItem: function () {
// TODO: trigger events on SB
$$log('trigger standby event ' + eventName, 'standby');
$body.trigger(eventName);
});
});

},
removeItem: function () {
window.localStorage = {
setItem: function ( name, data ) {

}
}
},
clear: function () {

detect: function () {
return !!window.gSTB;
},
getItem: function () {

exit: function () {
$$log('try to location change');
Player.stop(true);
gSTB.DeinitPlayer();
window.location = 'file:///home/web/services.html';
},
removeItem: function () {

sendReturn: function () {
this.exit();
},
}
}
},

getNativeDUID: function () {
detect: function () {
return !!window.gSTB;
},

},
exit: function () {
$$log('try to location change');
Player.stop(true);
gSTB.DeinitPlayer();
window.location = 'file:///home/web/services.html';
},

volumeUp: function () {
},
sendReturn: function () {
this.exit();
},

volumeDown: function () {
},
getMac: function () {
return stb.GetDeviceMacAddress();
},

getVolume: function () {
}
});
getNativeDUID: function () {
return stb.GetDeviceSerialNumber();
}
});

}());

Expand Down
2 changes: 1 addition & 1 deletion dist/smartbox.min.js

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions src/platforms/_browser/sb.platform.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,5 @@ SB.createPlatform('browser', {
this.DUID = 'FIREFOXISBEST';
}
return this.DUID;
},

volumeUp: function () {
},

volumeDown: function () {
},

getVolume: function () {
}


});
Loading

0 comments on commit 3cb7262

Please sign in to comment.