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 committed Oct 28, 2024
1 parent a58befc commit 791f9b1
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 @@ -4308,7 +4308,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 @@ -4346,7 +4346,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 @@ -4387,7 +4387,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 @@ -4645,7 +4645,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 @@ -4701,7 +4701,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 @@ -4914,7 +4914,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 @@ -5005,7 +5005,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 @@ -5119,7 +5119,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 @@ -5192,7 +5192,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 @@ -5235,7 +5235,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 @@ -5488,7 +5488,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 @@ -5516,7 +5516,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 791f9b1

Please sign in to comment.