Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

メニュー

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?

Migrating from 4.x to 5.x

This guide provides an introduction to the 5.x Programmable Video Android SDK and a set of guidelines to migrate an application from 4.x to 5.x.

Programming Model

The programming model has not changed from 4.x to 5.x. Refer to our 2.x migration guide for a refresher on the Video Android SDK models.

Region Selection

The SDK uses a new WebSocket based signaling transport, and communicates with globally available signaling Servers over IPv4 and IPv6 networks. The ConnectOptions.region property has been added which allows you to specify the region of the signaling server. By default, the Client will connect to the nearest signaling Server determined by latency based routing. Setting a value other than "gll" bypasses routing and guarantees that signaling traffic will be terminated in the region that you prefer.

ConnectOptions connectOptions = 
    new ConnectOptions.Builder("token").
    region("us1").build();
Room room = Video.connect(context, connectOptions, roomListener)

If you were previously whitelisting signaling servers by IP address you will now need to whitelist the FQDN for the region that you are connecting to. See the Signaling Communication section of the IP Address Whitelisting guide for more information.

アクセストークン

With this new WebSocket based signaling transport, some modifications may need to be made to the Access Tokens that you generate. Specifically:

  • Ensure that the AccessToken does not contain a configuration profile sid. Configuration profiles were previously deprecated and are no longer supported.
  • Set the Time-To-Live (TTL) of your AccessToken to the maximum allowed session duration, currently 14400 seconds (4 hours). This ensures that when a network loss occurs the client will be able to re-authenticate the reconnection. Note, a reconnection attempt with an expired AccessToken will result in an AccessTokenExpiredError.
Rate this page:

ヘルプが必要ですか?

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