Option for audio streaming
This commit is contained in:
parent
303ea16492
commit
20e57d15fd
3 changed files with 15 additions and 0 deletions
|
@ -31,6 +31,7 @@ import QuestionDialog from "../dialogs/QuestionDialog";
|
||||||
import {WidgetType} from "../../../widgets/WidgetType";
|
import {WidgetType} from "../../../widgets/WidgetType";
|
||||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||||
import { Container, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore";
|
import { Container, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore";
|
||||||
|
import { getConfigLivestreamUrl, startJitsiAudioLivestream } from "../../../Livestream";
|
||||||
|
|
||||||
interface IProps extends React.ComponentProps<typeof IconizedContextMenu> {
|
interface IProps extends React.ComponentProps<typeof IconizedContextMenu> {
|
||||||
app: IApp;
|
app: IApp;
|
||||||
|
@ -54,6 +55,17 @@ const WidgetContextMenu: React.FC<IProps> = ({
|
||||||
const widgetMessaging = WidgetMessagingStore.instance.getMessagingForId(app.id);
|
const widgetMessaging = WidgetMessagingStore.instance.getMessagingForId(app.id);
|
||||||
const canModify = userWidget || WidgetUtils.canUserModifyWidgets(roomId);
|
const canModify = userWidget || WidgetUtils.canUserModifyWidgets(roomId);
|
||||||
|
|
||||||
|
let streamAudioStreamButton;
|
||||||
|
if (getConfigLivestreamUrl() && (app.type === "m.jitsi" || app.type === "jitsi")) {
|
||||||
|
const onStreamAudioClick = () => {
|
||||||
|
startJitsiAudioLivestream(widgetMessaging, roomId);
|
||||||
|
onFinished();
|
||||||
|
};
|
||||||
|
streamAudioStreamButton = <IconizedContextMenuOption
|
||||||
|
onClick={onStreamAudioClick} label={_t("Start audio stream")}
|
||||||
|
/>;
|
||||||
|
}
|
||||||
|
|
||||||
let unpinButton;
|
let unpinButton;
|
||||||
if (showUnpin) {
|
if (showUnpin) {
|
||||||
const onUnpinClick = () => {
|
const onUnpinClick = () => {
|
||||||
|
@ -163,6 +175,7 @@ const WidgetContextMenu: React.FC<IProps> = ({
|
||||||
|
|
||||||
return <IconizedContextMenu {...props} chevronFace={ChevronFace.None} onFinished={onFinished}>
|
return <IconizedContextMenu {...props} chevronFace={ChevronFace.None} onFinished={onFinished}>
|
||||||
<IconizedContextMenuOptionList>
|
<IconizedContextMenuOptionList>
|
||||||
|
{ streamAudioStreamButton }
|
||||||
{ editButton }
|
{ editButton }
|
||||||
{ revokeButton }
|
{ revokeButton }
|
||||||
{ deleteButton }
|
{ deleteButton }
|
||||||
|
|
|
@ -2357,6 +2357,7 @@
|
||||||
"Set status": "Set status",
|
"Set status": "Set status",
|
||||||
"Set a new status...": "Set a new status...",
|
"Set a new status...": "Set a new status...",
|
||||||
"View Community": "View Community",
|
"View Community": "View Community",
|
||||||
|
"Start audio stream": "Start audio stream",
|
||||||
"Take a picture": "Take a picture",
|
"Take a picture": "Take a picture",
|
||||||
"Delete Widget": "Delete Widget",
|
"Delete Widget": "Delete Widget",
|
||||||
"Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?": "Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?",
|
"Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?": "Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?",
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { IWidgetApiRequest } from "matrix-widget-api";
|
||||||
export enum ElementWidgetActions {
|
export enum ElementWidgetActions {
|
||||||
ClientReady = "im.vector.ready",
|
ClientReady = "im.vector.ready",
|
||||||
HangupCall = "im.vector.hangup",
|
HangupCall = "im.vector.hangup",
|
||||||
|
StartLiveStream = "im.vector.start_live_stream",
|
||||||
OpenIntegrationManager = "integration_manager_open",
|
OpenIntegrationManager = "integration_manager_open",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue