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

fix audio-only hls

This commit is contained in:
Luke Pulverenti 2015-05-24 14:33:28 -04:00
parent e396019903
commit 2e982826bb
13 changed files with 99 additions and 57 deletions

View file

@ -1535,7 +1535,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
} }
.detailsMenuContentInner { .detailsMenuContentInner {
height: 200px; height: 220px;
} }
.detailsMenuOverview { .detailsMenuOverview {
@ -1573,6 +1573,13 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
line-height: .5; line-height: .5;
} }
@media all and (max-height:500px) {
.detailsMenuUserData {
display: none;
}
}
@media all and (min-height:500px) { @media all and (min-height:500px) {
.detailsMenuContentInner { .detailsMenuContentInner {

View file

@ -39,7 +39,19 @@
vertical-align: middle; vertical-align: middle;
text-align: left; text-align: left;
font-size: 15px; font-size: 15px;
max-width: 150px; max-width: 130px;
}
@media (min-width: 500px) {
.nowPlayingText {
max-width: 180px;
}
}
@media (min-width: 600px) {
.nowPlayingText {
max-width: 200px;
}
} }
@media (min-width: 800px) { @media (min-width: 800px) {

View file

@ -128,13 +128,11 @@
return false; return false;
} }
if (!$.browser.mobile) { if ($.browser.mobile) {
return true; return false;
} }
var screenWidth = $(window).width(); return true;
return screenWidth >= 600;
} }
function enabled() { function enabled() {

View file

@ -28,8 +28,11 @@
var PlayerName = 'Chromecast'; var PlayerName = 'Chromecast';
var applicationID = "2D4B1DA3"; //var applicationID = "2D4B1DA3";
var messageNamespace = 'urn:x-cast:com.connectsdk'; //var messageNamespace = 'urn:x-cast:com.connectsdk';
var applicationID = "F4EB2E8E";
var messageNamespace = 'urn:x-cast:com.google.cast.mediabrowser.v3';
var CastPlayer = function () { var CastPlayer = function () {
@ -184,6 +187,8 @@
this.session = null; this.session = null;
this.deviceState = DEVICE_STATE.IDLE; this.deviceState = DEVICE_STATE.IDLE;
this.castPlayerState = PLAYER_STATE.IDLE; this.castPlayerState = PLAYER_STATE.IDLE;
console.log('sessionUpdateListener: setting currentMediaSession to null');
this.currentMediaSession = null; this.currentMediaSession = null;
MediaController.removeActivePlayer(PlayerName); MediaController.removeActivePlayer(PlayerName);
@ -271,6 +276,8 @@
console.log(message); console.log(message);
this.deviceState = DEVICE_STATE.IDLE; this.deviceState = DEVICE_STATE.IDLE;
this.castPlayerState = PLAYER_STATE.IDLE; this.castPlayerState = PLAYER_STATE.IDLE;
console.log('onStopAppSuccess: setting currentMediaSession to null');
this.currentMediaSession = null; this.currentMediaSession = null;
}; };
@ -405,6 +412,7 @@
CastPlayer.prototype.setReceiverVolume = function (mute, vol) { CastPlayer.prototype.setReceiverVolume = function (mute, vol) {
if (!this.currentMediaSession) { if (!this.currentMediaSession) {
console.log('this.currentMediaSession is null');
return; return;
} }
@ -425,7 +433,6 @@
* Mute CC * Mute CC
*/ */
CastPlayer.prototype.mute = function () { CastPlayer.prototype.mute = function () {
this.audio = false;
this.setReceiverVolume(true); this.setReceiverVolume(true);
}; };
@ -613,6 +620,7 @@
options: {}, options: {},
command: 'Mute' command: 'Mute'
}); });
//castPlayer.mute();
}; };
self.unMute = function () { self.unMute = function () {

View file

@ -15,7 +15,7 @@
} }
function enableScrollX() { function enableScrollX() {
return AppInfo.isTouchPreferred; return AppInfo.isTouchPreferred && AppInfo.enableAppLayouts;
} }
function getThumbShape() { function getThumbShape() {

View file

@ -663,7 +663,7 @@
var userData = LibraryBrowser.getUserDataIconsHtml(item); var userData = LibraryBrowser.getUserDataIconsHtml(item);
if (userData) { if (userData) {
contentHtml += '<p>' + userData + '</p>'; contentHtml += '<p class="detailsMenuUserData">' + userData + '</p>';
} }
var ratingHtml = LibraryBrowser.getRatingHtml(item); var ratingHtml = LibraryBrowser.getRatingHtml(item);
@ -756,7 +756,11 @@
setItemIntoOverlay(elem, 0); setItemIntoOverlay(elem, 0);
} }
function onCardClick() { function onCardClick(e) {
if ($(e.target).is('.itemSelectionPanel') || $('.itemSelectionPanel', this).length) {
return false;
}
var info = LibraryBrowser.getListItemInfo(this); var info = LibraryBrowser.getListItemInfo(this);
var itemId = info.id; var itemId = info.id;

View file

@ -37,7 +37,7 @@
return targets; return targets;
}; };
var supportsAac = document.createElement('audio').canPlayType('audio/aac').replace(/no/, ''); var canPlayAac = document.createElement('audio').canPlayType('audio/aac').replace(/no/, '');
self.getVideoQualityOptions = function (videoWidth) { self.getVideoQualityOptions = function (videoWidth) {
@ -153,7 +153,7 @@
Type: 'Audio' Type: 'Audio'
}); });
if (supportsAac) { if (canPlayAac) {
profile.DirectPlayProfiles.push({ profile.DirectPlayProfiles.push({
Container: 'aac', Container: 'aac',
Type: 'Audio' Type: 'Audio'
@ -173,24 +173,6 @@
profile.TranscodingProfiles = []; profile.TranscodingProfiles = [];
if ($.browser.safari) {
profile.TranscodingProfiles.push({
Container: 'aac',
Type: 'Audio',
AudioCodec: 'aac',
Context: 'Streaming',
Protocol: 'http'
});
} else {
profile.TranscodingProfiles.push({
Container: 'mp3',
Type: 'Audio',
AudioCodec: 'mp3',
Context: 'Streaming',
Protocol: 'http'
});
}
if (self.canPlayHls()) { if (self.canPlayHls()) {
profile.TranscodingProfiles.push({ profile.TranscodingProfiles.push({
Container: 'ts', Container: 'ts',
@ -200,6 +182,16 @@
Context: 'Streaming', Context: 'Streaming',
Protocol: 'hls' Protocol: 'hls'
}); });
if (canPlayAac) {
profile.TranscodingProfiles.push({
Container: 'aac',
Type: 'Audio',
AudioCodec: 'aac',
Context: 'Streaming',
Protocol: 'hls'
});
}
} }
if (canPlayWebm) { if (canPlayWebm) {
@ -223,6 +215,24 @@
Protocol: 'http' Protocol: 'http'
}); });
if (canPlayAac && $.browser.safari) {
profile.TranscodingProfiles.push({
Container: 'aac',
Type: 'Audio',
AudioCodec: 'aac',
Context: 'Streaming',
Protocol: 'http'
});
} else {
profile.TranscodingProfiles.push({
Container: 'mp3',
Type: 'Audio',
AudioCodec: 'mp3',
Context: 'Streaming',
Protocol: 'http'
});
}
profile.ContainerProfiles = []; profile.ContainerProfiles = [];
var audioConditions = []; var audioConditions = [];
@ -1685,21 +1695,6 @@
var currentTicks = self.getCurrentTicks(this); var currentTicks = self.getCurrentTicks(this);
self.setCurrentTime(currentTicks); self.setCurrentTime(currentTicks);
if ($.browser.safari) {
if (self.currentDurationTicks) {
// Seeing transcoded audio looping in safari, going past the runtime but restarting the audio
if (currentTicks > self.currentDurationTicks) {
if (currentPlaylistIndex < self.playlist.length - 1) {
self.nextTrack();
} else {
self.stop();
}
}
}
}
} }
function playAudio(item, mediaSource, startPositionTicks) { function playAudio(item, mediaSource, startPositionTicks) {

View file

@ -11,7 +11,7 @@
} }
function enableScrollX() { function enableScrollX() {
return AppInfo.isTouchPreferred; return AppInfo.isTouchPreferred && AppInfo.enableAppLayouts;
} }
function getPortraitShape() { function getPortraitShape() {

View file

@ -8,7 +8,7 @@
} }
function enableScrollX() { function enableScrollX() {
return AppInfo.isTouchPreferred; return AppInfo.isTouchPreferred && AppInfo.enableAppLayouts;
} }
function getSquareShape() { function getSquareShape() {

View file

@ -1554,7 +1554,10 @@ var AppInfo = {};
AppInfo.enableMovieTrailersTab = true; AppInfo.enableMovieTrailersTab = true;
} }
if (!isCordova) { if (isCordova) {
AppInfo.enableAppLayouts = true;
}
else {
AppInfo.enableFooterNotifications = true; AppInfo.enableFooterNotifications = true;
AppInfo.enableSupporterMembership = true; AppInfo.enableSupporterMembership = true;
} }
@ -1573,7 +1576,7 @@ var AppInfo = {};
.on("websocketmessage.dashboard", Dashboard.onWebSocketMessageReceived) .on("websocketmessage.dashboard", Dashboard.onWebSocketMessageReceived)
.on('requestfail.dashboard', Dashboard.onRequestFail); .on('requestfail.dashboard', Dashboard.onRequestFail);
} }
//localStorage.clear();
function createConnectionManager(appInfo) { function createConnectionManager(appInfo) {
var credentialProvider = new MediaBrowser.CredentialProvider(); var credentialProvider = new MediaBrowser.CredentialProvider();

View file

@ -106,7 +106,7 @@
} }
function enableScrollX() { function enableScrollX() {
return AppInfo.isTouchPreferred; return AppInfo.isTouchPreferred && AppInfo.enableAppLayouts;
} }
function getThumbShape() { function getThumbShape() {

View file

@ -228,6 +228,7 @@
var credentials = credentialProvider.credentials(); var credentials = credentialProvider.credentials();
server.DateLastAccessed = new Date().getTime(); server.DateLastAccessed = new Date().getTime();
server.Id = result.ServerId;
if (saveCredentials) { if (saveCredentials) {
server.UserId = result.User.Id; server.UserId = result.User.Id;
@ -666,12 +667,16 @@
var servers = foundServers.map(function (foundServer) { var servers = foundServers.map(function (foundServer) {
return { var info = {
Id: foundServer.Id, Id: foundServer.Id,
LocalAddress: foundServer.Address, LocalAddress: foundServer.Address,
Name: foundServer.Name, Name: foundServer.Name,
ManualAddress: convertEndpointAddressToManualAddress(foundServer) ManualAddress: convertEndpointAddressToManualAddress(foundServer)
}; };
info.LastConnectionMode = info.ManualAddress ? MediaBrowser.ConnectionMode.Manual : MediaBrowser.ConnectionMode.Local;
return info;
}); });
deferred.resolveWith(null, [servers]); deferred.resolveWith(null, [servers]);
}); });

View file

@ -48,6 +48,10 @@
self.addOrUpdateServer = function (list, server) { self.addOrUpdateServer = function (list, server) {
if (!server.Id) {
throw new Error('Server.Id cannot be null or empty');
}
var existing = list.filter(function (s) { var existing = list.filter(function (s) {
return s.Id == server.Id; return s.Id == server.Id;
})[0]; })[0];
@ -76,9 +80,15 @@
if (server.WakeOnLanInfos && server.WakeOnLanInfos.length) { if (server.WakeOnLanInfos && server.WakeOnLanInfos.length) {
existing.WakeOnLanInfos = server.WakeOnLanInfos; existing.WakeOnLanInfos = server.WakeOnLanInfos;
} }
if (server.LastConnectionMode != null) {
existing.LastConnectionMode = server.LastConnectionMode;
}
return existing;
} }
else { else {
list.push(server); list.push(server);
return server;
} }
}; };
}; };