Skip to content

Commit

Permalink
Production release PR (#2237)
Browse files Browse the repository at this point in the history
* Hotfix backmerge to main

* fix: active speaker sorting

* feat: leaderboard for quizzes

* feat: handle polls via timed metadata

* fix: low volume on mweb

* fix: count for total quiz questions

* fix: cta text for quiz, title for interaction

* fix: peers with write permissions should be able to see leaderboard (#2243)

* fix: quiz response ui

* feat: added caption for hls stream

* fix: poll notifs in stream (#2244)

* fix: update env

* fix: live streaming black screen for hls viewer (#2246)

* fix: live streaming black screen for hls viewer

* fix: update react icons size validation

* fix: response ui, participation summary (#2247)

* fix: response ui, part. summary

* fix: clean up

* fix: new msg pill padding

* fix: refactor getpeerresponse

* fix: closed captions design parity (#2248)

* fix: closed captions design parity

* fix: captions opacity

* fix: hide shadow

* fix: alignment (#2249)

* fix: index for weight (#2250)

* build: update versions for release 

Co-authored-by: eswarclynn <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ravi theja <[email protected]>
Co-authored-by: Kaustubh Kumar <[email protected]>
Co-authored-by: Amar Bathwal <[email protected]>
Co-authored-by: Saikat Mitra <[email protected]>
Co-authored-by: eswarclynn <[email protected]>
  • Loading branch information
6 people authored Dec 8, 2023
1 parent 7221b6b commit 648c4ff
Show file tree
Hide file tree
Showing 70 changed files with 921 additions and 222 deletions.
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-web/package.json

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

15 changes: 15 additions & 0 deletions packages/hms-video-web/src/audio-sink-manager/AudioSinkManager.ts
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { HMSInteractivityCenter } from '../../interfaces/session-store/interacti
import {
HMSPoll,
HMSPollCreateParams,
HMSPollLeaderboardResponse,
HMSPollQuestionAnswer,
HMSPollQuestionOption,
HMSPollQuestionResponse,
HMSPollQuestionResponseCreateParams,
HMSPollQuestionType,
HMSPollStates,
HMSPollUserTrackingMode,
} from '../../interfaces/session-store/polls';
import { IStore } from '../../sdk/store';
Expand Down Expand Up @@ -170,6 +172,32 @@ export class InteractivityCenter implements HMSInteractivityCenter {

return question;
}

async fetchLeaderboard(poll: HMSPoll, offset: number, count: number): Promise<HMSPollLeaderboardResponse> {
const canReadPolls = this.store.getLocalPeer()?.role?.permissions.pollRead || false;

if (poll.anonymous || poll.state !== HMSPollStates.STOPPED || !canReadPolls) {
return { entries: [], hasNext: false };
}
const pollLeaderboard = await this.transport.fetchLeaderboard({
poll_id: poll.id,
count,
offset,
});

const leaderboardEntries = pollLeaderboard.questions.map(question => {
return {
position: question.position,
totalResponses: question.total_responses,
correctResponses: question.correct_responses,
duration: question.duration,
peer: question.peer,
score: question.score,
};
});

return { entries: leaderboardEntries, hasNext: !pollLeaderboard.last };
}
}

export const createHMSPollFromPollParams = (pollParams: PollInfoParams): HMSPoll => {
Expand Down
Loading

2 comments on commit 648c4ff

@vercel
Copy link

@vercel vercel bot commented on 648c4ff Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 648c4ff Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

storybook-app – ./packages/roomkit-react

storybook-app-100mslive.vercel.app
storybook-app-five.vercel.app
storybook-app-git-production-100mslive.vercel.app
ui.100ms.live

Please sign in to comment.