Handles the closure of a media producer.

This function performs the following steps:

  1. Retrieves updated parameters.
  2. Finds the transport associated with the producer to close.
  3. Closes the consumer transport and consumer if found.
  4. Updates the consumer transports list.
  5. Calls closeAndResize with the necessary parameters.
  6. If the producer kind is "screenshare" or "screen", updates shared state and calls various update methods.
const options: ProducerMediaClosedOptions = {
producerId: "12345",
kind: "screenshare",
parameters: {
consumerTransports: [{ producerId: "12345", consumerTransport: someTransport, consumer: someConsumer }],
updateConsumerTransports: (transports) => console.log("Updated transports:", transports),
hostLabel: "Host1",
shared: true,
updateShared: (shared) => console.log("Updated shared state:", shared),
updateShareScreenStarted: (started) => console.log("Screen sharing started:", started),
updateScreenId: (screenId) => console.log("Screen ID updated:", screenId),
updateShareEnded: (ended) => console.log("Share ended:", ended),
closeAndResize: async (params) => console.log("Closed and resized:", params),
prepopulateUserMedia: async (params) => console.log("Prepopulated user media:", params),
reorderStreams: async (params) => console.log("Reordered streams:", params),
getUpdatedAllParams: () => (),
},
};

await producerMediaClosed(options);