1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

chromecast testing

This commit is contained in:
Luke Pulverenti 2014-08-18 22:49:16 -04:00
parent 46f50bae6a
commit 952106daa9
6 changed files with 58 additions and 32 deletions

View file

@ -54,13 +54,13 @@
<fieldset data-role="controlgroup">
<legend>${LabelSupportedMediaTypes}</legend>
<input type="checkbox" data-mini="true" id="chkAudio" data-value="Audio" class="chkMediaType" />
<input type="checkbox" id="chkAudio" data-value="Audio" class="chkMediaType" />
<label for="chkAudio">${OptionProfileAudio}</label>
<input type="checkbox" data-mini="true" id="chkPhoto" data-value="Photo" class="chkMediaType" />
<input type="checkbox" id="chkPhoto" data-value="Photo" class="chkMediaType" />
<label for="chkPhoto">${OptionProfilePhoto}</label>
<input type="checkbox" data-mini="true" id="chkVideo" data-value="Video" class="chkMediaType" />
<input type="checkbox" id="chkVideo" data-value="Video" class="chkMediaType" />
<label for="chkVideo">${OptionProfileVideo}</label>
</fieldset>

View file

@ -63,10 +63,10 @@
<div class="chapterDownloadSettings" style="display: none;">
<fieldset data-role="controlgroup">
<legend>${HeaderDownloadChaptersFor}</legend>
<input type="checkbox" data-mini="true" id="chkDownloadChapterMovies" />
<input type="checkbox" id="chkDownloadChapterMovies" />
<label for="chkDownloadChapterMovies">${OptionMovies}</label>
<input type="checkbox" data-mini="true" id="chkDownloadChapterEpisodes" />
<input type="checkbox" id="chkDownloadChapterEpisodes" />
<label for="chkDownloadChapterEpisodes">${OptionEpisodes}</label>
</fieldset>
<br />
@ -84,13 +84,13 @@
<li>
<label>${HeaderExtractChapterImagesFor}</label>
<div data-role="controlgroup">
<input type="checkbox" data-mini="true" id="chkChaptersMovies" />
<input type="checkbox" id="chkChaptersMovies" />
<label for="chkChaptersMovies">${OptionMovies}</label>
<input type="checkbox" data-mini="true" id="chkChaptersEpisodes" />
<input type="checkbox" id="chkChaptersEpisodes" />
<label for="chkChaptersEpisodes">${OptionEpisodes}</label>
<input type="checkbox" data-mini="true" id="chkChaptersOtherVideos" />
<input type="checkbox" id="chkChaptersOtherVideos" />
<label for="chkChaptersOtherVideos">${OptionOtherVideos}</label>
<div class="fieldDescription">${ExtractChapterImagesHelp}</div>
</div>
@ -107,25 +107,25 @@
<li>
<label>${HeaderDownloadPeopleMetadataFor}</label>
<div data-role="controlgroup">
<input type="checkbox" data-mini="true" id="chkPeopleActors" />
<input type="checkbox" id="chkPeopleActors" />
<label for="chkPeopleActors">${OptionActors}</label>
<input type="checkbox" data-mini="true" id="chkPeopleComposers" />
<input type="checkbox" id="chkPeopleComposers" />
<label for="chkPeopleComposers">${OptionComposers}</label>
<input type="checkbox" data-mini="true" id="chkPeopleDirectors" />
<input type="checkbox" id="chkPeopleDirectors" />
<label for="chkPeopleDirectors">${OptionDirectors}</label>
<input type="checkbox" data-mini="true" id="chkPeopleGuestStars" />
<input type="checkbox" id="chkPeopleGuestStars" />
<label for="chkPeopleGuestStars">${OptionGuestStars}</label>
<input type="checkbox" data-mini="true" id="chkPeopleProducers" />
<input type="checkbox" id="chkPeopleProducers" />
<label for="chkPeopleProducers">${OptionProducers}</label>
<input type="checkbox" data-mini="true" id="chkPeopleWriters" />
<input type="checkbox" id="chkPeopleWriters" />
<label for="chkPeopleWriters">${OptionWriters}</label>
<input type="checkbox" data-mini="true" id="chkPeopleOthers" />
<input type="checkbox" id="chkPeopleOthers" />
<label for="chkPeopleOthers">${OptionOthers}</label>
<div class="fieldDescription">${HeaderDownloadPeopleMetadataForHelp}</div>
</div>

View file

@ -28,9 +28,9 @@
<br />
<div style="margin: 0 1em;" data-role="controlgroup">
<label for="chkDisplayCollectionView">${LabelDisplayCollectionsView}</label>
<input id="chkDisplayCollectionView" type="checkbox" data-mini="true" />
<input id="chkDisplayCollectionView" type="checkbox" />
<label for="chkDisplayFolderView">${LabelDisplayFoldersView}</label>
<input id="chkDisplayFolderView" type="checkbox" data-mini="true" />
<input id="chkDisplayFolderView" type="checkbox" />
</div>
<br /><br />

View file

@ -20,7 +20,7 @@
var isChecked = config.DownloadingChannels.indexOf(channel.Id) != -1 ? ' checked="checked"' : '';
html += '<input class="chkChannelDownload" type="checkbox" name="' + id + '" id="' + id + '" data-channelid="' + channel.Id + '" data-mini="true"' + isChecked + '>';
html += '<input class="chkChannelDownload" type="checkbox" name="' + id + '" id="' + id + '" data-channelid="' + channel.Id + '"' + isChecked + '>';
html += '<label for="' + id + '">' + channel.Name + '</label>';
}

View file

@ -205,6 +205,7 @@
this.deviceState = DEVICE_STATE.ACTIVE;
this.session.addMessageListener(messageNamespace, this.messageListener.bind(this));
this.session.addMediaListener(this.sessionMediaListener.bind(this));
this.session.addUpdateListener(this.sessionUpdateListener.bind(this));
$(this).trigger('connect');
@ -212,6 +213,16 @@
MediaController.setActivePlayer(PlayerName);
};
/**
* session update listener
*/
CastPlayer.prototype.sessionMediaListener = function (e) {
console.log('sessionMediaListener');
this.currentMediaSession = e;
this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler);
};
/**
* Callback function for launch error
*/
@ -259,17 +270,22 @@
return;
}
this.sendMessage({
options: options,
command: command
});
};
CastPlayer.prototype.sendMessage = function (message) {
var player = this;
var message = {
options: options,
command: command,
message = $.extend(message, {
userId: Dashboard.getCurrentUserId(),
deviceId: ApiClient.deviceId(),
accessToken: ApiClient.accessToken(),
serverAddress: ApiClient.serverAddress()
};
});
// If the user is on localhost we need a different address to send to the receiver
var address = message.serverAddress.toLowerCase();
@ -278,20 +294,21 @@
ApiClient.getSystemInfo().done(function (info) {
message.serverAddress = info.WanAddress;
player.sendMessage(message);
player.sendMessageInternal(message);
});
} else {
player.sendMessage(message);
player.sendMessageInternal(message);
}
};
CastPlayer.prototype.sendMessage = function(message) {
CastPlayer.prototype.sendMessageInternal = function (message) {
message = JSON.stringify(message);
//console.log(message);
this.session.sendMessage(messageNamespace, message, this.onPlayCommandSuccess.bind(this), this.errorHandler);
}
};
CastPlayer.prototype.onPlayCommandSuccess = function () {
console.log('Message was sent to receiver ok.');
@ -514,6 +531,9 @@
$(castPlayer).on("playbackstart", function (e, data) {
console.log('cc: playbackstart');
castPlayer.initializeCastPlayer();
var state = self.getPlayerStateInternal(data);
$(self).trigger("playbackstart", [state]);
});
@ -636,6 +656,10 @@
self.displayContent = function (options) {
castPlayer.sendMessage({
options: options,
command: 'DisplayContent'
});
};
self.mute = function () {
@ -683,7 +707,8 @@
"Mute",
"Unmute",
"ToggleMute",
"SetVolume"]
"SetVolume",
"DisplayContent"]
};
};
@ -747,6 +772,7 @@
data = data || self.lastPlayerData;
self.lastPlayerData = data;
console.log(JSON.stringify(data));
return data;
};

View file

@ -54,7 +54,7 @@
var checkedAttribute = user.Configuration.BlockedMediaFolders.indexOf(folder.Id) == -1 && user.Configuration.BlockedMediaFolders.indexOf(folder.Name) == -1 ? ' checked="checked"' : '';
html += '<input class="chkMediaFolder" data-foldername="' + folder.Id + '" type="checkbox" data-mini="true" id="' + id + '"' + checkedAttribute + ' />';
html += '<input class="chkMediaFolder" data-foldername="' + folder.Id + '" type="checkbox" id="' + id + '"' + checkedAttribute + ' />';
html += '<label for="' + id + '">' + folder.Name + '</label>';
}
@ -79,7 +79,7 @@
var checkedAttribute = user.Configuration.BlockedChannels.indexOf(folder.Id) == -1 ? ' checked="checked"' : '';
html += '<input class="chkChannel" data-foldername="' + folder.Id + '" type="checkbox" data-mini="true" id="' + id + '"' + checkedAttribute + ' />';
html += '<input class="chkChannel" data-foldername="' + folder.Id + '" type="checkbox" id="' + id + '"' + checkedAttribute + ' />';
html += '<label for="' + id + '">' + folder.Name + '</label>';
}
@ -123,7 +123,7 @@
var checkedAttribute = user.Configuration.BlockUnratedItems.indexOf(item.value) != -1 ? ' checked="checked"' : '';
html += '<input class="chkUnratedItem" data-itemtype="' + item.value + '" type="checkbox" data-mini="true" id="' + id + '"' + checkedAttribute + ' />';
html += '<input class="chkUnratedItem" data-itemtype="' + item.value + '" type="checkbox" id="' + id + '"' + checkedAttribute + ' />';
html += '<label for="' + id + '">' + item.name + '</label>';
}