Skip to content

Commit

Permalink
Revert "feat(FEC-13507): Doc entry methods"
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanTGold authored Jan 23, 2024
1 parent 94891b7 commit 4af1c20
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 58 deletions.
4 changes: 0 additions & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2592,10 +2592,6 @@ Returns **[boolean][476]** true if sources contain youtube source
returns true if sources contain image source
## hasDocumentSource
returns true if sources contain document source
### Parameters
- `sources` **PKSourcesConfigObject** thr sources object
Expand Down
2 changes: 1 addition & 1 deletion src/common/playlist/playlist-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
SourcesConfig,
KPPlaylistItemConfigObject
} from '../../types';
const formats = ['hls', 'dash', 'progressive', 'image', 'document'];
const formats = ['hls', 'dash', 'progressive', 'image'];
/**
* @class PlaylistItem
* @param {PKSourcesConfigObject} [sources] - The item sources
Expand Down
15 changes: 1 addition & 14 deletions src/common/playlist/playlist-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ class PlaylistManager {
this._player = player;
this._eventManager = new EventManager();
this._playlist = new Playlist();
this._options = {
autoContinue: true,
loop: false,
imageDuration: 5,
documentDuration: 5
};
this._options = { autoContinue: true, loop: false, imageDuration: 5 };
this._countdown = { duration: 10, showing: true };
this._mediaInfoList = [];
this._playerOptions = options;
Expand Down Expand Up @@ -286,8 +281,6 @@ class PlaylistManager {
// @ts-ignore
items: playlistData.items.map((item, index) => {
const itemData = Utils.Object.copyDeep(item);
// keep original media source data
itemData.sources.mediaEntryType = item?.sources?.type;
['sources.dvr', 'sources.type'].forEach((omitKey) => {
// use medias source data instead of playlist source data
Utils.Object.deletePropertyPath(itemData, omitKey);
Expand Down Expand Up @@ -355,12 +348,6 @@ class PlaylistManager {
// @ts-ignore
sources: { duration: this._options.imageDuration }
});
} else if (this._player.isDocument()) {
this._player.configure({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
sources: { duration: this._options.documentDuration }
});
}
}

Expand Down
16 changes: 0 additions & 16 deletions src/common/utils/setup-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -889,9 +889,6 @@ function maybeSetStreamPriority(
if (sources && hasImageSource(sources)) {
return addEngineToStreamPriority(player, 'image', 'image');
}
if (sources && hasDocumentSource(sources)) {
return addEngineToStreamPriority(player, 'document', 'document');
}
return null;
}

Expand All @@ -917,18 +914,6 @@ function hasImageSource(sources: PKSourcesConfigObject): boolean {
return !!(source && source[0]);
}

/**
* returns true if sources contain document source
* @param {PKSourcesConfigObject} sources - thr sources object
* @returns {boolean} - true if sources contain document source
*/
function hasDocumentSource(sources: PKSourcesConfigObject): boolean {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const source = sources && sources.document;
return !!(source && source[0]);
}

/**
* Maybe set inBrowserFullscreen config based on the plugins.
* @private
Expand Down Expand Up @@ -1033,7 +1018,6 @@ export {
maybeSetStreamPriority,
hasYoutubeSource,
hasImageSource,
hasDocumentSource,
mergeProviderPluginsConfig,
getServerUIConf,
initializeStorageManagers,
Expand Down
25 changes: 3 additions & 22 deletions src/kaltura-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import { PlaylistManager } from './common/playlist/playlist-manager';
import { RemotePlayerManager } from './common/cast/remote-player-manager';
import {
hasImageSource,
hasDocumentSource,
hasYoutubeSource,
maybeSetStreamPriority,
mergeProviderPluginsConfig,
Expand Down Expand Up @@ -230,18 +229,14 @@ export class KalturaPlayer extends FakeEventTarget {
playerConfig.plugins[name] = playerConfig.plugins[name] || {};
});
this.configure({ session: mediaConfig.session });
if (
hasYoutubeSource(sources) ||
hasImageSource(sources) ||
hasDocumentSource(sources)
) {
this._thumbnailManager = null;
} else {
if (!hasYoutubeSource(sources) && !hasImageSource(sources)) {
this._thumbnailManager = new ThumbnailManager(
this,
this.config.ui,
mediaConfig
);
} else {
this._thumbnailManager = null;
}
this.updateKalturaPoster(
sources,
Expand Down Expand Up @@ -475,24 +470,10 @@ export class KalturaPlayer extends FakeEventTarget {
);
}

public isUntimedDocument(): boolean {
return (
hasDocumentSource(this.sources) &&
!(
typeof this.config.sources.duration === 'number' &&
this.config.sources.duration > 0
)
);
}

public isImage(): boolean {
return hasImageSource(this.sources);
}

public isDocument(): boolean {
return hasDocumentSource(this.sources);
}

public isAudio(): boolean {
return this._localPlayer.isAudio();
}
Expand Down
1 change: 0 additions & 1 deletion src/types/playlist/playlist-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ export interface PlaylistOptions {
autoContinue: boolean;
loop: boolean;
imageDuration: number;
documentDuration: number;
}

0 comments on commit 4af1c20

Please sign in to comment.