Edit confirmed settings from an active broadcast tile

This commit is contained in:
omar committed 2026-11-27 08:39:14 +03:00
1 parent f563d2ba9a
commit 1e2856e261
11 files changed
+177 -4

No files matched your search

@@ -54,6 +54,15 @@ pub(super) async fn project(ctx:&RuntimeServices)->Result<Vec<StreamPresentation
if matches!(snapshot.state,PublisherState::Starting|PublisherState::Live){
let target=Target{session:Some(key.clone()),entity:Entity::CaptureSource("capture-preview".into()),name:snapshot.options.name.clone(),own_channel_id:channel};
let mut actions=vec![action(&target,Operation::CaptureStop,&catalog),action(&target,Operation::StreamStats,&catalog)];
if snapshot.state==PublisherState::Live {
let owner=connection.server.as_deref().and_then(|server|server["clients"].as_array())
.and_then(|clients|clients.iter().find(|client|client["id"].as_u64()==Some(u64::from(publisher.own_client_id))))
.and_then(|client|client["uid"].as_str()).filter(|uid|!uid.is_empty());
if let (Some(id),Some(uid))=(snapshot.stream_id.as_ref(),owner){
let edit=Target{entity:Entity::Stream{id:id.clone(),owner_uid:uid.to_owned()},..target.clone()};
actions.insert(0,action(&edit,Operation::StreamEdit,&catalog));
}
}
for viewer in &snapshot.pending{let target=admission_target(&target,&snapshot,viewer);actions.push(action(&target,Operation::StreamAdmit,&catalog));actions.push(action(&target,Operation::StreamReject,&catalog));}
for viewer in &snapshot.viewers{actions.push(action(&admission_target(&target,&snapshot,viewer),Operation::StreamRemoveViewer,&catalog));}
result.push(StreamPresentation{id:tile_id(key,"capture-preview"),title:target.name.clone(),status:format!("{:?}; viewers={}; pending={}; {}",snapshot.state,snapshot.viewers.len(),snapshot.pending.len(),snapshot.detail),volume:0.0,actions,target});