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
+3 -5
View File
@@ -128,13 +128,11 @@
return false;
}
if (!$.browser.mobile) {
return true;
if ($.browser.mobile) {
return false;
}
var screenWidth = $(window).width();
return screenWidth >= 600;
return true;
}
function enabled() {
+11 -3
View File
@@ -28,8 +28,11 @@
var PlayerName = 'Chromecast';
var applicationID = "2D4B1DA3";
var messageNamespace = 'urn:x-cast:com.connectsdk';
//var applicationID = "2D4B1DA3";
//var messageNamespace = 'urn:x-cast:com.connectsdk';
var applicationID = "F4EB2E8E";
var messageNamespace = 'urn:x-cast:com.google.cast.mediabrowser.v3';
var CastPlayer = function () {
@@ -184,6 +187,8 @@
this.session = null;
this.deviceState = DEVICE_STATE.IDLE;
this.castPlayerState = PLAYER_STATE.IDLE;
console.log('sessionUpdateListener: setting currentMediaSession to null');
this.currentMediaSession = null;
MediaController.removeActivePlayer(PlayerName);
@@ -271,6 +276,8 @@
console.log(message);
this.deviceState = DEVICE_STATE.IDLE;
this.castPlayerState = PLAYER_STATE.IDLE;
console.log('onStopAppSuccess: setting currentMediaSession to null');
this.currentMediaSession = null;
};
@@ -405,6 +412,7 @@
CastPlayer.prototype.setReceiverVolume = function (mute, vol) {
if (!this.currentMediaSession) {
console.log('this.currentMediaSession is null');
return;
}
@@ -425,7 +433,6 @@
* Mute CC
*/
CastPlayer.prototype.mute = function () {
this.audio = false;
this.setReceiverVolume(true);
};
@@ -613,6 +620,7 @@
options: {},
command: 'Mute'
});
//castPlayer.mute();
};
self.unMute = function () {
+1 -1
View File
@@ -15,7 +15,7 @@
}
function enableScrollX() {
return AppInfo.isTouchPreferred;
return AppInfo.isTouchPreferred && AppInfo.enableAppLayouts;
}
function getThumbShape() {
+6 -2
View File
@@ -663,7 +663,7 @@
var userData = LibraryBrowser.getUserDataIconsHtml(item);
if (userData) {
contentHtml += '<p>' + userData + '</p>';
contentHtml += '<p class="detailsMenuUserData">' + userData + '</p>';
}
var ratingHtml = LibraryBrowser.getRatingHtml(item);
@@ -756,7 +756,11 @@
setItemIntoOverlay(elem, 0);
}
function onCardClick() {
function onCardClick(e) {
if ($(e.target).is('.itemSelectionPanel') || $('.itemSelectionPanel', this).length) {
return false;
}
var info = LibraryBrowser.getListItemInfo(this);
var itemId = info.id;
+30 -35
View File
@@ -37,7 +37,7 @@
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) {
@@ -153,7 +153,7 @@
Type: 'Audio'
});
if (supportsAac) {
if (canPlayAac) {
profile.DirectPlayProfiles.push({
Container: 'aac',
Type: 'Audio'
@@ -173,24 +173,6 @@
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()) {
profile.TranscodingProfiles.push({
Container: 'ts',
@@ -200,6 +182,16 @@
Context: 'Streaming',
Protocol: 'hls'
});
if (canPlayAac) {
profile.TranscodingProfiles.push({
Container: 'aac',
Type: 'Audio',
AudioCodec: 'aac',
Context: 'Streaming',
Protocol: 'hls'
});
}
}
if (canPlayWebm) {
@@ -223,6 +215,24 @@
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 = [];
var audioConditions = [];
@@ -1685,21 +1695,6 @@
var currentTicks = self.getCurrentTicks(this);
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) {
+1 -1
View File
@@ -11,7 +11,7 @@
}
function enableScrollX() {
return AppInfo.isTouchPreferred;
return AppInfo.isTouchPreferred && AppInfo.enableAppLayouts;
}
function getPortraitShape() {
+1 -1
View File
@@ -8,7 +8,7 @@
}
function enableScrollX() {
return AppInfo.isTouchPreferred;
return AppInfo.isTouchPreferred && AppInfo.enableAppLayouts;
}
function getSquareShape() {
+5 -2
View File
@@ -1554,7 +1554,10 @@ var AppInfo = {};
AppInfo.enableMovieTrailersTab = true;
}
if (!isCordova) {
if (isCordova) {
AppInfo.enableAppLayouts = true;
}
else {
AppInfo.enableFooterNotifications = true;
AppInfo.enableSupporterMembership = true;
}
@@ -1573,7 +1576,7 @@ var AppInfo = {};
.on("websocketmessage.dashboard", Dashboard.onWebSocketMessageReceived)
.on('requestfail.dashboard', Dashboard.onRequestFail);
}
//localStorage.clear();
function createConnectionManager(appInfo) {
var credentialProvider = new MediaBrowser.CredentialProvider();
+1 -1
View File
@@ -106,7 +106,7 @@
}
function enableScrollX() {
return AppInfo.isTouchPreferred;
return AppInfo.isTouchPreferred && AppInfo.enableAppLayouts;
}
function getThumbShape() {