Skip to content

Commit

Permalink
fix: Don't use info from MSE mode when using Remote Playback (#7504)
Browse files Browse the repository at this point in the history
Related to #5022
  • Loading branch information
avelad authored Oct 25, 2024
1 parent b2b4238 commit e14a8eb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -4343,7 +4343,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
isLive() {
if (this.manifest_) {
if (this.manifest_ && !this.isRemotePlayback()) {
return this.manifest_.presentationTimeline.isLive();
}

Expand Down Expand Up @@ -4381,7 +4381,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
isAudioOnly() {
if (this.manifest_) {
if (this.manifest_ && !this.isRemotePlayback()) {
const variants = this.manifest_.variants;
if (!variants.length) {
return false;
Expand Down Expand Up @@ -4422,7 +4422,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
seekRange() {
if (this.manifest_) {
if (this.manifest_ && !this.isRemotePlayback()) {
// With HLS lazy-loading, there were some situations where the manifest
// had partially loaded, enough to move onto further load stages, but no
// segments had been loaded, so the timeline is still unknown.
Expand Down Expand Up @@ -4680,7 +4680,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
getVariantTracks() {
if (this.manifest_) {
if (this.manifest_ && !this.isRemotePlayback()) {
const currentVariant = this.streamingEngine_ ?
this.streamingEngine_.getCurrentVariant() : null;

Expand Down Expand Up @@ -4736,7 +4736,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
getTextTracks() {
if (this.manifest_) {
if (this.manifest_ && !this.isRemotePlayback()) {
const currentTextStream = this.streamingEngine_ ?
this.streamingEngine_.getCurrentTextStream() : null;
const tracks = [];
Expand Down Expand Up @@ -4949,7 +4949,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
selectTextTrack(track) {
if (this.manifest_ && this.streamingEngine_) {
if (this.manifest_ && this.streamingEngine_&& !this.isRemotePlayback()) {
const stream = this.manifest_.textStreams.find(
(stream) => stream.id == track.id);

Expand Down Expand Up @@ -5042,7 +5042,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
selectVariantTrack(track, clearBuffer = false, safeMargin = 0) {
if (this.manifest_ && this.streamingEngine_) {
if (this.manifest_ && this.streamingEngine_&& !this.isRemotePlayback()) {
const variant = this.manifest_.variants.find(
(variant) => variant.id == track.id);
if (!variant) {
Expand Down Expand Up @@ -5156,7 +5156,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
*/
selectAudioLanguage(language, role, channelsCount = 0, safeMargin = 0,
codec = '') {
if (this.manifest_ && this.playhead_) {
if (this.manifest_ && this.playhead_&& !this.isRemotePlayback()) {
this.currentAdaptationSetCriteria_ =
new shaka.media.PreferenceBasedCriteria(
language,
Expand Down Expand Up @@ -5229,7 +5229,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
selectTextLanguage(language, role, forced = false) {
if (this.manifest_ && this.playhead_) {
if (this.manifest_ && this.playhead_ && !this.isRemotePlayback()) {
this.currentTextLanguage_ = language;
this.currentTextRole_ = role || '';
this.currentTextForced_ = forced;
Expand Down Expand Up @@ -5273,7 +5273,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
selectVariantsByLabel(label, clearBuffer = true, safeMargin = 0) {
if (this.manifest_ && this.playhead_) {
if (this.manifest_ && this.playhead_ && !this.isRemotePlayback()) {
let firstVariantWithLabel = null;
for (const variant of this.manifest_.variants) {
if (variant.audio.label == label) {
Expand Down Expand Up @@ -5527,7 +5527,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
presentationTime = this.startTime_;
}

if (this.manifest_) {
if (this.manifest_ && !this.isRemotePlayback()) {
const timeline = this.manifest_.presentationTimeline;
const startTime = timeline.getInitialProgramDateTime() ||
timeline.getPresentationStartTime();
Expand Down Expand Up @@ -5555,7 +5555,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* @export
*/
getPresentationStartTimeAsDate() {
if (this.manifest_) {
if (this.manifest_ && !this.isRemotePlayback()) {
const timeline = this.manifest_.presentationTimeline;
const startTime = timeline.getInitialProgramDateTime() ||
timeline.getPresentationStartTime();
Expand Down

0 comments on commit e14a8eb

Please sign in to comment.