Skip to content

Commit

Permalink
feat(project): add default_player_id to config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
olga-jwp committed Jan 6, 2023
1 parent b6bb06f commit fac3038
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ export const ADYEN_LIVE_CLIENT_KEY = 'live_BQDOFBYTGZB3XKF62GBYSLPUJ4YW2TPL';

// how often the live channel schedule is refetched in ms
export const LIVE_CHANNELS_REFETCH_INTERVAL = 15 * 60_000;

// OTT shared player
export const DEFAULT_PLAYER_ID: string = 'M4qoGvUk';
6 changes: 3 additions & 3 deletions src/containers/PlayerContainer/PlayerContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useConfigStore } from '#src/stores/ConfigStore';
import Player from '#components/Player/Player';
import type { JWPlayer } from '#types/jwplayer';
import { useWatchHistoryStore } from '#src/stores/WatchHistoryStore';
import { VideoProgressMinMax } from '#src/config';
import { DEFAULT_PLAYER_ID, VideoProgressMinMax } from '#src/config';

type Props = {
item: PlaylistItem;
Expand Down Expand Up @@ -40,7 +40,7 @@ const PlayerContainer: React.FC<Props> = ({
liveStartDateTime,
autostart,
}: Props) => {
const { player, features } = useConfigStore((s) => s.config);
const { features } = useConfigStore((s) => s.config);
const continueWatchingList = features?.continueWatchingList;
const watchHistoryEnabled = !!continueWatchingList;

Expand Down Expand Up @@ -116,7 +116,7 @@ const PlayerContainer: React.FC<Props> = ({

return (
<Player
playerId={player}
playerId={DEFAULT_PLAYER_ID}
feedId={feedId}
item={item}
onReady={handleReady}
Expand Down
3 changes: 0 additions & 3 deletions src/utils/configLoad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ export async function loadAndValidateConfig(configSource: string | undefined) {
let config = await loadConfig(configSource);
config.assets = config.assets || {};

//set default value for the OTT shared player
config.player = 'M4qoGvUk';

// make sure the banner always defaults to the JWP banner when not defined in the config
if (!config.assets.banner) {
config.assets.banner = defaultConfig.assets.banner;
Expand Down

0 comments on commit fac3038

Please sign in to comment.