Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Player] Remove playback progress event #120

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/player/src/internal/event-tracking/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ export async function commit(baseCommitData: BaseCommitData) {
| string
| undefined;

// streamingSessionId not allowed in the progress event
if (event.name === 'progress' && 'streamingSessionId' in event.payload) {
delete event.payload.streamingSessionId;
}

if (oldNestedHeader) {
const credentials =
await credentialsProviderStore.credentialsProvider.getCredentials();
Expand Down
20 changes: 0 additions & 20 deletions packages/player/src/internal/event-tracking/playback/index.ts

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions packages/player/src/internal/event-tracking/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { PlaybackSession } from './play-log/playback-session';
import type { Progress } from './playback/progress';
import type { DrmLicenseFetch } from './streaming-metrics/drm-license-fetch';
import type { PlaybackInfoFetch } from './streaming-metrics/playback-info-fetch';
import type { PlaybackStatistics } from './streaming-metrics/playback-statistics';
Expand Down Expand Up @@ -27,7 +26,6 @@ export type PrematureEvents =
| PlaybackInfoFetch
| PlaybackSession
| PlaybackStatistics
| Progress
| StreamingSessionEnd
| StreamingSessionStart;

Expand Down
33 changes: 0 additions & 33 deletions packages/player/src/player/basePlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { MediaProduct, PlaybackState } from '../api/interfaces';
import * as Config from '../config';
import { events } from '../event-bus';
import * as PlayLog from '../internal/event-tracking/play-log/index';
import * as Playback from '../internal/event-tracking/playback/index';
import * as StreamingMetrics from '../internal/event-tracking/streaming-metrics/index';
import {
type BasePayload as PlaybackStatisticsPayload,
Expand Down Expand Up @@ -126,7 +125,6 @@ export class BasePlayer {
endAssetPosition,
endReason,
});
this.reportPlaybackProgress(streamingSessionId);

streamingSessionStore.deleteSession(streamingSessionId);

Expand Down Expand Up @@ -533,35 +531,6 @@ export class BasePlayer {
return Promise.resolve();
}

reportPlaybackProgress(streamingSessionId: string) {
const mediaProductTransition =
streamingSessionStore.getMediaProductTransition(streamingSessionId);

if (!mediaProductTransition) {
return;
}

const { mediaProduct, playbackContext } = mediaProductTransition;

if (this.#currentStreamingSessionId) {
Playback.commit([
Playback.progress({
playback: {
durationMS: Math.floor(playbackContext.actualDuration * 1000),
id: mediaProduct.productId,
playedMS: Math.floor(this.currentTime * 1000),
source: {
id: mediaProduct.sourceId,
type: mediaProduct.sourceType,
},
type: mediaProduct.productType === 'track' ? 'TRACK' : 'VIDEO',
},
streamingSessionId: this.#currentStreamingSessionId,
}),
]).catch(console.error);
}
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
reset(_options: { keepPreload: boolean }) {
return Promise.resolve();
Expand Down Expand Up @@ -767,8 +736,6 @@ export class BasePlayer {
return;
case fromTo('PLAYING', 'NOT_PLAYING'):
case fromTo('PLAYING', 'IDLE'): {
this.reportPlaybackProgress(this.currentStreamingSessionId);

if (this.duration && this.currentTime < this.duration) {
PlayLog.playbackSessionAction(this.currentStreamingSessionId, {
actionType: 'PLAYBACK_STOP',
Expand Down