メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Using the Track Priority API

概要

Not all video tracks are equal. For example, in a webinar application the screen share track is more important than the webcams, while in a video collaboration service the dominant speaker has more relevance than the rest of the participants.

To account for this, Twilio has created the Track Priority API, which makes it possible to set the priority of Tracks. The priority of a Track can be set to any of the following values:

  • high
  • standard
  • low

Track priorities can be understood as the relative relevance of Tracks. This means that, from the Twilio perspective, any Track marked as high will be more important than any standard Track, which in turn will be more relevant that any low priority Track.

Currently, the Network Bandwidth Profile API consumes Track priorities to determine which Tracks are more relevant from the bandwidth allocation perspective. In the future Twilio may use Track priorities for other further purposes.

ベータ

The Track Priority API is currently available as a BETA product. Some features are not yet implemented and others may be changed before the product is declared as Generally Available. BETA products are not covered by a Twilio SLA. See this article for more information on Beta product support.

目次

SDK Compatibility

The Track Priority API is only available in Group Rooms (including Small Group Rooms). The following table illustrates current support:

Twilio Video SDK Track Priority API
JavaScript 2.0.0-beta14+
Android もう少しです
iOS もう少しです

Publisher Track Priorities

By default any published Track has priority standard. Developers can specify a different Track priority at publish time. Once set, the Track priority can be read both at the local and remote Track publications. The following code snippets show how this can be done:

JavaScript SDK (Required v2.0.0-beta14+)

//You can set the track priority at publish time
const localTrackPublication = await room.localParticipant.publishTrack(localTrack, {
  priority: 'high' //choose among 'high', 'standard' or 'low'
});
//Track priority can also be read.
assert.equal(localTrackPublication.priority, 'high');

//Track priority can also be read at the RemoteTrackPublication.
remoteParticipant.on('trackPublished', remoteTrackPublication => {
  console.log(`RemoteTrackPublication with priority ${remoteTrackPublication.publishPriority}`);
});

Android SDK

Coming soon

iOS SDK

Coming soon
Luis Lopez
Rate this page:

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。