Skip to content

Commit

Permalink
Merge pull request #146 from twilio/prep-release
Browse files Browse the repository at this point in the history
  • Loading branch information
olipyskoty committed Jul 11, 2022
2 parents 7dcde87 + 884524e commit f793002
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 1.1.0 (July 11, 2022)

### New Feature

- This release adds a chat feature for the host, speakers, and viewers. This feature allows all users to send and receive textual messages to each other while connected to a stream. This feature is powered by the [Twilio Conversations API](https://www.twilio.com/conversations-api) and is optional. See the [README.md](https://github.com/twilio/twilio-live-interactive-video/blob/feature/audience-chat/README.md#set-your-account-sid-and-auth-token) for more information on how to opt out.

### Bug Fixes

- Fixes an issue where the host could not create more than one stream. [#116](https://github.com/twilio/twilio-live-interactive-video/pull/116)

# 1.0.0 (February 28, 2022)

This is the initial release of the Twilio Live Interactive Video iOS and web Apps. This project demonstrates an interactive live video streaming app that uses [Twilio Live](https://www.twilio.com/docs/live), [Twilio Video](https://www.twilio.com/docs/video) and [Twilio Sync](https://www.twilio.com/docs/sync).
Expand Down
5 changes: 1 addition & 4 deletions apps/web/src/components/ChatProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import React, { createContext, useCallback, useEffect, useRef, useState } from '
import { Client } from '@twilio/conversations';
import { Conversation } from '@twilio/conversations/lib/conversation';
import { Message } from '@twilio/conversations/lib/message';
import { isMobile } from '../../utils';
import useVideoContext from '../../hooks/useVideoContext/useVideoContext';
import { useAppState } from '../../state';

type ChatContextType = {
isChatWindowOpen: boolean;
Expand All @@ -20,9 +18,8 @@ export const ChatContext = createContext<ChatContextType>(null!);

export const ChatProvider: React.FC = ({ children }) => {
const { onError } = useVideoContext();
const { appState } = useAppState();
const isChatWindowOpenRef = useRef(false);
const [isChatWindowOpen, setIsChatWindowOpen] = useState(isMobile || !appState.isChatEnabled ? false : true);
const [isChatWindowOpen, setIsChatWindowOpen] = useState(false);
const [conversation, setConversation] = useState<Conversation | null>(null);
const [messages, setMessages] = useState<Message[]>([]);
const [hasUnreadMessages, setHasUnreadMessages] = useState(false);
Expand Down
7 changes: 6 additions & 1 deletion apps/web/src/components/PreJoinScreens/PreJoinScreens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ import { useEnqueueSnackbar } from '../../hooks/useSnackbar/useSnackbar';
import usePlayerContext from '../../hooks/usePlayerContext/usePlayerContext';
import useVideoContext from '../../hooks/useVideoContext/useVideoContext';
import useSyncContext from '../../hooks/useSyncContext/useSyncContext';
import { isMobile } from '../../utils';

export default function PreJoinScreens() {
const { getAudioAndVideoTracks } = useVideoContext();
const { connect: chatConnect } = useChatContext();
const { connect: chatConnect, setIsChatWindowOpen } = useChatContext();
const { connect: videoConnect } = useVideoContext();
const { connect: playerConnect, disconnect: playerDisconnect } = usePlayerContext();
const { connect: syncConnect, registerUserDocument, registerSyncMaps } = useSyncContext();
Expand All @@ -36,6 +37,7 @@ export default function PreJoinScreens() {
if (data.chat_enabled) {
chatConnect(data.token, data.room_sid);
appDispatch({ type: 'set-is-chat-enabled', isChatEnabled: true });
if (!isMobile) setIsChatWindowOpen(true);
}
registerSyncMaps(data.sync_object_names);
playerDisconnect();
Expand All @@ -52,6 +54,7 @@ export default function PreJoinScreens() {
if (data.chat_enabled) {
chatConnect(data.token, data.room_sid);
appDispatch({ type: 'set-is-chat-enabled', isChatEnabled: true });
if (!isMobile) setIsChatWindowOpen(true);
}
break;
}
Expand All @@ -63,6 +66,7 @@ export default function PreJoinScreens() {
if (data.chat_enabled) {
chatConnect(data.token, data.room_sid);
appDispatch({ type: 'set-is-chat-enabled', isChatEnabled: true });
if (!isMobile) setIsChatWindowOpen(true);
}
break;
}
Expand All @@ -76,6 +80,7 @@ export default function PreJoinScreens() {
if (data.chat_enabled) {
chatConnect(data.token, data.room_sid);
appDispatch({ type: 'set-is-chat-enabled', isChatEnabled: true });
if (!isMobile) setIsChatWindowOpen(true);
}
break;
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twilio-live-interactive-video",
"version": "1.0.0",
"version": "1.1.0",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit f793002

Please sign in to comment.