update card layouts
This commit is contained in:
parent
8f4f29888e
commit
bb38230c23
46 changed files with 1086 additions and 332 deletions
|
@ -57,18 +57,15 @@
|
|||
}
|
||||
|
||||
var params = [artist, title, album, url, duration, elapsedTime];
|
||||
window.remoteControls.updateMetas(onUpdateMetasSuccess, onUpdateMetasFail, params);
|
||||
try {
|
||||
window.remoteControls.updateMetas(onUpdateMetasSuccess, onUpdateMetasFail, params);
|
||||
} catch (err) {
|
||||
onUpdateMetasFail(err);
|
||||
}
|
||||
}
|
||||
|
||||
function onStateChanged(e, state) {
|
||||
|
||||
//console.log('nowplaying event: ' + e.type);
|
||||
var player = this;
|
||||
|
||||
if (player.isDefaultPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
||||
return;
|
||||
}
|
||||
|
||||
updatePlayerState(state);
|
||||
}
|
||||
|
||||
|
@ -115,7 +112,12 @@
|
|||
var elapsedTime = 0;
|
||||
|
||||
var params = [artist, title, album, image, duration, elapsedTime];
|
||||
window.remoteControls.updateMetas(onUpdateMetasSuccess, onUpdateMetasFail, params);
|
||||
|
||||
try {
|
||||
window.remoteControls.updateMetas(onUpdateMetasSuccess, onUpdateMetasFail, params);
|
||||
} catch (err) {
|
||||
onUpdateMetasFail(err);
|
||||
}
|
||||
}
|
||||
|
||||
function onUpdateMetasSuccess() {
|
||||
|
@ -125,7 +127,7 @@
|
|||
|
||||
function onUpdateMetasFail(fail) {
|
||||
|
||||
console.log('onUpdateMetasFail' + fail);
|
||||
console.log('onUpdateMetasFail: ' + fail);
|
||||
}
|
||||
|
||||
function bindToPlayer(player) {
|
||||
|
@ -138,6 +140,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
console.log('binding remotecontrols to MediaPlayer');
|
||||
|
||||
player.getPlayerState().done(function (state) {
|
||||
|
||||
if (state.NowPlayingItem) {
|
||||
|
@ -153,8 +157,12 @@
|
|||
.on('positionchange.cordovaremote', onStateChanged);
|
||||
}
|
||||
|
||||
console.log('binding remotecontrols to MediaController');
|
||||
|
||||
document.addEventListener("deviceready", function () {
|
||||
|
||||
console.log('binding remotecontrols to MediaController');
|
||||
|
||||
$(function () {
|
||||
|
||||
$(MediaController).on('playerchange', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue