PublishedTrack
The Published Track resource is a subresource of a Participant instance resource. It represents the Tracks a Participant is currently publishing to the Room.
Using the Published Track resource, you can query tracks published to a Room. You can also get a list of Tracks associated with a given Participant.
1/v1/Rooms/{RoomNameOrSid}/Participants/{ParticipantIdentityOrSid}/PublishedTracks/{TrackNameOrSid}2
The unique string that we created to identify the RoomParticipantPublishedTrack resource.
^MT[0-9a-fA-F]{32}$Min length: 34Max length: 34The SID of the Participant resource with the published track.
^PA[0-9a-fA-F]{32}$Min length: 34Max length: 34The SID of the Room resource where the track is published.
^RM[0-9a-fA-F]{32}$Min length: 34Max length: 34The track name. Must be no more than 128 characters, and be unique among the participant's published tracks.
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
The track type. Can be: audio, video or data.
audiovideodataThe absolute URL of the resource.
Returns a single Track resource represented by TrackNameOrSid.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function fetchRoomParticipantPublishedTrack() {14const publishedTrack = await client.video.v115.rooms("DailyStandup")16.participants("Alice")17.publishedTracks("Camera")18.fetch();1920console.log(publishedTrack.sid);21}2223fetchRoomParticipantPublishedTrack();
Response
1{2"room_sid": "DailyStandup",3"date_created": "2015-07-30T20:00:00Z",4"date_updated": "2015-07-30T20:00:00Z",5"participant_sid": "Alice",6"sid": "Camera",7"name": "bob-track",8"kind": "data",9"enabled": true,10"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks/MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"11}
Not supported.
1/v1/Rooms/{RoomNameOrSid}/Participants/{ParticipantIdentityOrSid}/PublishedTracks/2
Returns a list of tracks associated with a given Participant. The list includes paging information. Only currently Published Tracks are in the list resource.
Note: No filters supported.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function listRoomParticipantPublishedTrack() {14const publishedTracks = await client.video.v115.rooms("DailyStandup")16.participants("Alice")17.publishedTracks.list({ limit: 20 });1819publishedTracks.forEach((p) => console.log(p.sid));20}2122listRoomParticipantPublishedTrack();
Response
1{2"published_tracks": [],3"meta": {4"page": 0,5"page_size": 50,6"first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks?PageSize=50&Page=0",7"previous_page_url": null,8"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks?PageSize=50&Page=0",9"next_page_url": null,10"key": "published_tracks"11}12}