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

Production release PR #2237

Merged
merged 21 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
REACT_APP_ZIPY_KEY: ${{ secrets.PROD_ZIPY_KEY }}
REACT_APP_ENV: 'prod'
REACT_APP_ENABLE_BEAM_SPEAKERS_LOGGING: 'true'
REACT_APP_DASHBOARD_LINK: https://dashboard.100ms.live/

steps:
- name: log inputs
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
REACT_APP_ROOM_LAYOUT_ENDPOINT: https://api-nonprod.100ms.live/v2/layouts/ui
REACT_APP_TOKEN_BY_ROOM_CODE_ENDPOINT: https://auth-nonprod.100ms.live/v2/token
REACT_APP_DASHBOARD_BASE_ENDPOINT: https://qa-in2-ipv6.100ms.live/hmsapi/
REACT_APP_DASHBOARD_LINK: https://app-qa.100ms.live/

steps:
- name: log inputs
Expand Down
4 changes: 2 additions & 2 deletions apps/100ms-custom-app/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion apps/100ms-custom-app/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ const App = () => {
if ((authToken || roomCode) && hmsPrebuiltRef.current && isHeadless) {
const { hmsActions } = hmsPrebuiltRef.current;
hmsActions?.enableBeamSpeakerLabelsLogging?.();
hmsActions?.ignoreMessageTypes?.(['chat', 'EMOJI_REACTION']);
hmsActions?.ignoreMessageTypes?.([
'chat',
'EMOJI_REACTION',
'POLL_STARTED',
]);
hmsActions?.setAppData?.('disableNotifications', true);
}
}, [authToken, roomCode, isHeadless]);
Expand Down
10 changes: 5 additions & 5 deletions apps/100ms-web/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/100ms-web/src/components/Polls/Voting/Voting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const Voting = ({ id, toggleVoting }) => {
borderBottom: "1px solid $border_default",
}}
>
<Text variant="h6">{poll?.type?.toUpperCase()}</Text>
<Text variant="h6">{poll.title}</Text>
<StatusIndicator
isLive={isLive}
shouldShowTimer={isLive && isTimed}
Expand Down
2 changes: 1 addition & 1 deletion package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/hls-player/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions packages/hls-player/src/controllers/HMSHLSPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class HMSHLSPlayer implements IHMSHLSPlayer, IHMSHLSPlayerEventEmitter {
video.autoplay = true;
return video;
}

/**
* @returns get html video element
*/
Expand Down Expand Up @@ -194,6 +195,19 @@ export class HMSHLSPlayer implements IHMSHLSPlayer, IHMSHLSPlayerEventEmitter {
this._videoEl.currentTime = seekValue;
};

hasCaptions = () => {
return this._hls.subtitleTracks.length > 0;
};

toggleCaption = () => {
// no subtitles, do nothing
if (!this.hasCaptions()) {
return;
}
this._hls.subtitleDisplay = !this._hls.subtitleDisplay;
this.emitEvent(HMSHLSPlayerEvents.CAPTION_ENABLED, this._hls.subtitleDisplay);
};

private playVideo = async () => {
try {
if (this._videoEl.paused) {
Expand Down
1 change: 1 addition & 0 deletions packages/hls-player/src/interfaces/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type HMSHLSListenerDataMapping = {
[HMSHLSPlayerEvents.TIMED_METADATA_LOADED]: HMSHLSCue;
[HMSHLSPlayerEvents.STATS]: HlsPlayerStats;
[HMSHLSPlayerEvents.PLAYBACK_STATE]: HMSHLSPlaybackState;
[HMSHLSPlayerEvents.CAPTION_ENABLED]: boolean;

[HMSHLSPlayerEvents.ERROR]: HMSHLSException;
[HMSHLSPlayerEvents.CURRENT_TIME]: number;
Expand Down
1 change: 1 addition & 0 deletions packages/hls-player/src/utilies/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export enum HMSHLSPlayerEvents {

MANIFEST_LOADED = 'manifest-loaded',
LAYER_UPDATED = 'layer-updated',
CAPTION_ENABLED = 'caption-enabled',

ERROR = 'error',
PLAYBACK_STATE = 'playback-state',
Expand Down
2 changes: 1 addition & 1 deletion packages/hls-stats/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/hms-noise-suppression/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/hms-video-store/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
HMSPoll,
HMSPollCreateParams,
HMSPollQuestionCreateParams,
HMSPollQuestionResponseCreateParams,
Expand Down Expand Up @@ -32,4 +33,8 @@ export class HMSInteractivityCenter implements IHMSInteractivityCenter {
addResponsesToPoll(pollID: string, responses: HMSPollQuestionResponseCreateParams[]) {
return this.sdkInteractivityCenter.addResponsesToPoll(pollID, responses);
}

fetchLeaderboard(poll: HMSPoll, offset: number, count: number) {
return this.sdkInteractivityCenter.fetchLeaderboard(poll, offset, count);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ export const POLL_NOTIFICATION_TYPES: PollNotificationMap = {
[sdkTypes.HMSPollsUpdate.POLL_STARTED]: HMSNotificationTypes.POLL_STARTED,
[sdkTypes.HMSPollsUpdate.POLL_STOPPED]: HMSNotificationTypes.POLL_STOPPED,
[sdkTypes.HMSPollsUpdate.POLL_STATS_UPDATED]: HMSNotificationTypes.POLL_VOTES_UPDATED,
// [sdkTypes.HMSPollsUpdate.POLL_LEADERBOARD_SHARED]: HMSNotificationTypes.POLL_LEADERBOARD_SHARED,
};
2 changes: 2 additions & 0 deletions packages/hms-video-store/src/core/hmsSDKStore/sdkTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
HMSPlaylistSettings,
HMSPoll,
HMSPollCreateParams,
HMSPollLeaderboardResponse,
HMSPollQuestionAnswer,
HMSPollQuestionCreateParams,
HMSPollQuestionType,
Expand Down Expand Up @@ -124,6 +125,7 @@ export type {
TokenRequest,
TokenRequestOptions,
HMSPoll,
HMSPollLeaderboardResponse,
HMSPollCreateParams,
HMSPollQuestionAnswer,
HMSPollQuestionCreateParams,
Expand Down
1 change: 1 addition & 0 deletions packages/hms-video-store/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ export type {
HMSPollCreateParams,
HMSPollQuestionCreateParams,
HMSPollQuestionAnswer,
HMSPollLeaderboardResponse,
} from './hmsSDKStore/sdkTypes';
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {
HMSPoll,
HMSPollCreateParams,
HMSPollLeaderboardResponse,
HMSPollQuestionCreateParams,
HMSPollQuestionResponseCreateParams,
} from '@100mslive/hms-video';
Expand All @@ -10,4 +12,5 @@ export interface IHMSInteractivityCenter {
stopPoll(poll: string): Promise<void>;
addQuestionsToPoll(pollID: string, questions: HMSPollQuestionCreateParams[]): Promise<void>;
addResponsesToPoll(pollID: string, responses: HMSPollQuestionResponseCreateParams[]): Promise<void>;
fetchLeaderboard(poll: HMSPoll, offset: number, count: number): Promise<HMSPollLeaderboardResponse>;
}
3 changes: 3 additions & 0 deletions packages/hms-video-store/src/core/schema/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export interface HMSReconnectionNotification extends BaseNotification {

export interface HMSPollNotification extends BaseNotification {
type: HMSNotificationTypes.POLL_STARTED | HMSNotificationTypes.POLL_STOPPED | HMSNotificationTypes.POLL_VOTES_UPDATED;
// | HMSNotificationTypes.POLL_LEADERBOARD_SHARED;
data: HMSPoll;
}

Expand Down Expand Up @@ -124,6 +125,7 @@ export enum HMSNotificationTypes {
POLL_STARTED = 'POLL_STARTED',
POLL_STOPPED = 'POLL_STOPPED',
POLL_VOTES_UPDATED = 'POLL_VOTES_UPDATED',
// POLL_LEADERBOARD_SHARED = 'POLL_LEADERBOARD_SHARED',
HAND_RAISE_CHANGED = 'HAND_RAISE_CHANGED',
}

Expand Down Expand Up @@ -155,6 +157,7 @@ export type HMSNotificationMapping<T extends HMSNotificationTypes, C = any> = {
[HMSNotificationTypes.POLL_STARTED]: HMSPollNotification;
[HMSNotificationTypes.POLL_STOPPED]: HMSPollNotification;
[HMSNotificationTypes.POLL_VOTES_UPDATED]: HMSPollNotification;
// [HMSNotificationTypes.POLL_LEADERBOARD_SHARED]: HMSPollNotification;
[HMSNotificationTypes.POLL_CREATED]: HMSPollNotification;
[HMSNotificationTypes.HAND_RAISE_CHANGED]: HMSPeerNotification;
}[T];
Expand Down
2 changes: 1 addition & 1 deletion packages/hms-video-store/src/core/selectors/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export const selectHMSBroadcastMessages = createSelector(selectHMSMessages, mess
return messages.filter(m => !m.recipientPeer && !(m.recipientRoles && m.recipientRoles?.length > 0));
});
/**
* Select the nuber of unread broadcast messages
* Select the number of unread broadcast messages
*/
export const selectUnreadHMSBroadcastMessagesCount = createSelector(selectHMSBroadcastMessages, messages => {
return messages.filter(m => !m.read).length;
Expand Down
2 changes: 1 addition & 1 deletion packages/hms-video-web/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export class AudioSinkManager {
track.setVolume(this.volume);
HMSLogger.d(this.TAG, 'Audio track added', `${track}`);
this.init(); // call to create sink element if not already created
await this.autoSelectAudioOutput();
this.audioSink?.append(audioEl);
this.outputDevice && (await track.setOutputDevice(this.outputDevice));
audioEl.srcObject = new MediaStream([track.nativeTrack]);
Expand Down Expand Up @@ -259,4 +260,18 @@ export class AudioSinkManager {
track.setAudioElement(null);
}
};

/**
* Mweb is not able to play via call channel by default, this is to switch from media channel to call channel
*/
private autoSelectAudioOutput = async () => {
if (this.audioSink?.children.length === 0) {
const device = this.deviceManager.audioInput?.find(device => device.label.includes('earpiece'));
const localAudioTrack = this.store.getLocalPeer()?.audioTrack;
if (localAudioTrack && device) {
await localAudioTrack.setSettings({ deviceId: device?.deviceId });
await localAudioTrack.setSettings({ deviceId: 'default' });
}
}
};
}
25 changes: 23 additions & 2 deletions packages/hms-video-web/src/interfaces/session-store/polls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface HMSPollQuestion {
export interface HMSPollQuestionCreateParams extends Pick<HMSPollQuestion, 'text' | 'skippable' | 'type' | 'answer'> {
index?: number;
options?: HMSPollQuestionOptionCreateParams[];
weight?: number;
}

export interface HMSPollQuestionAnswer {
Expand All @@ -81,6 +82,12 @@ export enum HMSPollQuestionType {
LONG_ANSWER = 'long-answer',
}

export enum HMSPollStates {
CREATED = 'created',
STARTED = 'started',
STOPPED = 'stopped',
}

export interface HMSPollQuestionOption {
index: number;
text: string;
Expand All @@ -101,9 +108,9 @@ export interface HMSPollQuestionResponse {
option?: number;
options?: number[];
text?: string;
update?: boolean; // SDK Needs to track wether we previously answered and set accordingly
update?: boolean; // SDK Needs to track whether we previously answered and set accordingly
duration?: number; // Time it took to answer the question for leaderboard
responseFinal?: boolean; // Indicates wether this is last update when fetching responses
responseFinal?: boolean; // Indicates whether this is last update when fetching responses
}

export type HMSPollQuestionResponseCreateParams = Omit<
Expand Down Expand Up @@ -135,3 +142,17 @@ export interface HMSPollQuestionResult {
skippedCount?: number;
totalResponses?: number;
}

export interface HMSPollLeaderboardEntry {
position: number;
score: number;
totalResponses: number;
correctResponses: number;
duration: number;
peer: HMSPollResponsePeerInfo;
}

export interface HMSPollLeaderboardResponse {
entries: HMSPollLeaderboardEntry[];
hasNext: boolean;
}
1 change: 1 addition & 0 deletions packages/hms-video-web/src/interfaces/update-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export enum HMSPollsUpdate {
POLL_STARTED,
POLL_STOPPED,
POLL_STATS_UPDATED,
// POLL_LEADERBOARD_SHARED,
}

export interface HMSAudioListener {
Expand Down
Loading
Loading