install service with Emby name

This commit is contained in:
Luke Pulverenti 2015-05-23 16:44:15 -04:00
parent b26685b14d
commit e396019903
11 changed files with 63 additions and 111 deletions

View File

@ -144,11 +144,16 @@
.cardContent .cardFooter {
position: absolute;
bottom: 0;
background: rgba(0, 0, 0, .75);
left: 0;
color: #eee;
padding: 6px 0 2px 0;
max-width: 100%;
background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%) !important; /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0.7))) !important; /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.7) 100%) !important; /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.7) 100%) !important; /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.7) 100%) !important; /* IE10+ */
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0.75) 100%) !important; /* W3C */
}
.lightCardFooter {
@ -187,7 +192,7 @@
}
.cardContent .cardFooter .cardText {
font-size: 15px;
font-size: 14px;
}
.cardOverlayInner {

View File

@ -28,6 +28,7 @@
var PlayerName = 'Chromecast';
var applicationID = "2D4B1DA3";
var messageNamespace = 'urn:x-cast:com.connectsdk';
var CastPlayer = function () {
@ -72,14 +73,6 @@
return;
}
// v1 Id AE4DA10A
// v2 Id 472F0435
// v3 Id 69C59853
// v4 Id F4EB2E8E
// default receiver chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
var applicationID = "F4EB2E8E";
// request session
var sessionRequest = new chrome.cast.SessionRequest(applicationID);
var apiConfig = new chrome.cast.ApiConfig(sessionRequest,
@ -393,14 +386,6 @@
this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler);
};
/**
* Callback function when media load returns error
*/
CastPlayer.prototype.onLoadMediaError = function (e) {
console.log("chromecast media error");
this.castPlayerState = PLAYER_STATE.IDLE;
};
/**
* Callback function for media status update from receiver
* @param {!Boolean} e true/false
@ -413,46 +398,6 @@
console.log("chromecast updating media: " + e);
};
/**
* Play media in Cast mode
*/
CastPlayer.prototype.playMedia = function () {
if (!this.currentMediaSession) {
return;
}
this.currentMediaSession.play(null, this.mediaCommandSuccessCallback.bind(this, "playing started for " + this.currentMediaSession.sessionId), this.errorHandler);
//this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler);
};
/**
* Pause media playback in Cast mode
*/
CastPlayer.prototype.pauseMedia = function () {
if (!this.currentMediaSession) {
return;
}
this.currentMediaSession.pause(null, this.mediaCommandSuccessCallback.bind(this, "paused " + this.currentMediaSession.sessionId), this.errorHandler);
};
/**
* Stop CC playback
*/
CastPlayer.prototype.stopMedia = function () {
if (!this.currentMediaSession) {
return;
}
this.currentMediaSession.stop(null,
this.mediaCommandSuccessCallback.bind(this, "stopped " + this.currentMediaSession.sessionId),
this.errorHandler);
this.castPlayerState = PLAYER_STATE.STOPPED;
};
/**
* Set media volume in Cast mode
* @param {Boolean} mute A boolean
@ -484,39 +429,6 @@
this.setReceiverVolume(true);
};
/**
* media seek function in either Cast or local mode
* @param {Event} e An event object from seek
*/
CastPlayer.prototype.seekMedia = function (event) {
var pos = parseInt(event);
var curr = pos / 10000000;
if (!this.currentMediaSession) {
return;
}
var request = new chrome.cast.media.SeekRequest();
request.currentTime = curr;
this.currentMediaSession.seek(request,
this.onSeekSuccess.bind(this, 'media seek done'),
this.errorHandler);
this.castPlayerState = PLAYER_STATE.SEEKING;
};
/**
* Callback function for seek success
* @param {String} info A string that describe seek event
*/
CastPlayer.prototype.onSeekSuccess = function (info) {
console.log(info);
this.castPlayerState = PLAYER_STATE.PLAYING;
};
/**
* Callback function for media command success
*/
@ -624,11 +536,17 @@
};
self.unpause = function () {
castPlayer.playMedia();
castPlayer.sendMessage({
options: {},
command: 'Unpause'
});
};
self.pause = function () {
castPlayer.pauseMedia();
castPlayer.sendMessage({
options: {},
command: 'Pause'
});
};
self.shuffle = function (id) {
@ -676,7 +594,10 @@
};
self.stop = function () {
castPlayer.stopMedia();
castPlayer.sendMessage({
options: {},
command: 'Stop'
});
};
self.displayContent = function (options) {
@ -688,7 +609,10 @@
};
self.mute = function () {
castPlayer.mute();
castPlayer.sendMessage({
options: {},
command: 'Mute'
});
};
self.unMute = function () {
@ -748,7 +672,17 @@
};
self.seek = function (position) {
castPlayer.seekMedia(position);
position = parseInt(position);
position = position / 10000000;
castPlayer.sendMessage({
options: {
position: position
},
command: 'Seek'
});
};
self.setAudioStreamIndex = function (index) {
@ -813,7 +747,13 @@
vol = Math.min(vol, 100);
vol = Math.max(vol, 0);
castPlayer.setReceiverVolume(false, (vol / 100));
//castPlayer.setReceiverVolume(false, (vol / 100));
castPlayer.sendMessage({
options: {
volume: vol
},
command: 'SetVolume'
});
};
self.getPlayerState = function () {

View File

@ -641,7 +641,7 @@
imgUrl = 'css/images/clients/ios.png';
}
else {
imgUrl = 'css/images/clients/html5.png';
imgUrl = 'css/images/clients/android.png';
}
return "<img src='" + imgUrl + "' alt='Emby Mobile' />";

View File

@ -4,7 +4,7 @@
var html = '<div class="viewMenuBar ui-bar-b">';
if (($.browser.safari && window.navigator.standalone) || Dashboard.isRunningInCordova()) {
if (AppInfo.enableBackButton) {
html += '<button type="button" data-role="none" onclick="history.back();" class="headerButton headerButtonLeft headerBackButton"><div class="fa fa-arrow-left"></div></button>';
}

View File

@ -1095,7 +1095,7 @@
// Reports of stuttering with h264 stream copy in IE
if (streamInfo.playMethod == 'Transcode' && videoUrl.indexOf('.m3u8') == -1) {
videoUrl += 'EnableAutoStreamCopy=false';
videoUrl += '&EnableAutoStreamCopy=false';
}
var posterCode = self.getPosterUrl(item);

View File

@ -1561,6 +1561,8 @@ var AppInfo = {};
AppInfo.enableUserImage = true;
AppInfo.hasPhysicalVolumeButtons = isCordova || $.browser.mobile;
AppInfo.enableBackButton = ($.browser.safari && window.navigator.standalone) || (isCordova && $.browser.safari);
}
function initializeApiClient(apiClient) {
@ -1841,9 +1843,8 @@ var AppInfo = {};
}
function initCordovaWithDeviceId(deferred, deviceId) {
if ($.browser.safari) {
requirejs(['thirdparty/cordova/imagestore.js']);
}
requirejs(['thirdparty/cordova/imagestore.js']);
init(deferred, "Emby Mobile", deviceId, device.model, true);
}

View File

@ -82,6 +82,8 @@
$(document).on('pageinitdepends', "#wizardSettingsPage", function () {
var page = this;
$('.wizardSettingsForm', page).off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshowready', "#wizardSettingsPage", function () {

View File

@ -847,7 +847,7 @@
skipTest = true;
}
enableRetry = true;
timeout = 7000;
timeout = 5000;
}
else if (mode == MediaBrowser.ConnectionMode.Manual) {

View File

@ -1,7 +1,7 @@
(function () {
var PlayerName = "Chromecast";
var ApplicationID = "F4EB2E8E";
var ApplicationID = "2D4B1DA3";
var currentPairingDeviceId;
var currentPairedDeviceId;
var currentDeviceFriendlyName;

View File

@ -46,9 +46,9 @@
var deferred = DeferredBuilder.Deferred();
if (name == 'playback') {
validatePlayback();
validatePlayback(deferred);
} else if (name == 'livetv') {
validateLiveTV();
validateLiveTV(deferred);
} else {
deferred.resolve();
}

View File

@ -135,14 +135,18 @@
deviceReadyPromise.done(function () {
findServersInternal(timeoutMs).done(function (result) {
try {
findServersInternal(timeoutMs).done(function (result) {
deferred.resolveWith(null, [result]);
deferred.resolveWith(null, [result]);
}).fail(function () {
}).fail(function () {
deferred.reject();
});
} catch (err) {
deferred.reject();
});
}
});
return deferred.promise();