Session broadcast button

add broadcast button which send a message to the client
This commit is contained in:
Nuwan 2024-08-21 22:41:23 +05:30
parent 279ba30506
commit 7ea8a1e8fa
3 changed files with 18 additions and 2 deletions

View File

@ -224,6 +224,7 @@
LastUsedProfileName: enumAppCounter++,
LeaveSession: enumAppCounter++,
LeaveSessionAndMinimize: enumAppCounter++,
LaunchBroadcastSettings: enumAppCounter++,
log: enumAppCounter++,
NetworkTest: enumAppCounter++,
NetworkTestResult: enumAppCounter++,

View File

@ -529,6 +529,10 @@
dbg('LeaveSession:' + JSON.stringify(map));
}
function LaunchBroadcastSettings() {
dbg('LaunchBroadcastSettings');
}
// this is not a real bridge method; purely used by the fake jam client
function RegisterP2PMessageCallbacks(callbacks) {
p2pCallbacks = callbacks;
@ -1547,6 +1551,7 @@
this.JoinSession = JoinSession;
this.LatencyUpdated = LatencyUpdated;
this.LeaveSession = LeaveSession;
this.LaunchBroadcastSettings = LaunchBroadcastSettings;
this.P2PMessageReceived = P2PMessageReceived;
this.ParticipantJoined = ParticipantJoined;
this.ParticipantLeft = ParticipantLeft;

View File

@ -1,4 +1,5 @@
context = window
rest = context.JK.rest
@SessionShareBtn = React.createClass({
@ -9,10 +10,19 @@ context = window
@app.layout.showDialog('share-dialog')
onClickBroadCast: `async function(e) {
e.preventDefault()
try {
await context.jamClient.LaunchBroadcastSettings()
} catch (e) {
console.error(e)
}
}`
render: () ->
`<a className="session-share button-grey left" onClick={this.onShare}>
`<a className="session-share button-grey left" onClick={this.onClickBroadCast}>
<img src="/assets/content/icon_share.png" align="texttop" height="14" width="14"/>
SHARE
BROADCAST
</a>`
onAppInit: (app) ->