我正在尝试遵循本教程:https ://www.youtube.com/watch?v= 5lrdYBLEk60 并且当我遵循所有内容到发球台时,我得到了无效的访问令牌 - 代码:20101 返回。除了添加带有身份的 Twilio 函数链接之外,我在提供的 VideoQuickStart 中没有进行任何更改:https://carnelian-chinook-9032.twil.io/video-token?identity=doug
功能代码(与视频链接相同):
exports.handler = function(context, event, callback) {
const AccessToken = Twilio.jwt.AccessToken;
const VideoGrant = AccessToken.VideoGrant;
const token = new AccessToken(context.ACCOUNT_SID, context.API_KEY, context.API_SECRET);
token.identity = event.identity;
const videoGrant = new VideoGrant({
room: 'TestingRoom'
});
token.addGrant(videoGrant);
callback(null, { token: token.toJwt() });
};
VideoQuickStart 示例中 ViewController.swift 的开头
import UIKit
import TwilioVideo
class ViewController: UIViewController {
// MARK: View Controller Members
// Configure access token manually for testing, if desired! Create one manually in the console
// at https://www.twilio.com/console/video/runtime/testing-tools
var accessToken = "TWILIO_ACCESS_TOKEN"
// Configure remote URL to fetch token from
var tokenUrl = "https://carnelian-chinook-9032.twil.io/video-token?identity=doug"
// Video SDK components
var room: TVIRoom?
var camera: TVICameraSource?
var localVideoTrack: TVILocalVideoTrack?
var localAudioTrack: TVILocalAudioTrack?
var remoteParticipant: TVIRemoteParticipant?
var remoteView: TVIVideoView?
// MARK: UI Element Outlets and handles
// `TVIVideoView` created from a storyboard
@IBOutlet weak var previewView: TVIVideoView!
@IBOutlet weak var connectButton: UIButton!
@IBOutlet weak var disconnectButton: UIButton!
@IBOutlet weak var messageLabel: UILabel!
@IBOutlet weak var roomTextField: UITextField!
@IBOutlet weak var roomLine: UIView!
@IBOutlet weak var roomLabel: UILabel!
@IBOutlet weak var micButton: UIButton!
// MARK: UIViewController
override func viewDidLoad() {
super.viewDidLoad()
self.title = "QuickStart"
....
有人知道我可以为此尝试什么吗?或者他们是否可以按照本教程进行操作并且最终效果如何?也许教程有点过时了?也许我需要在我的帐户上启用某些东西?有什么帮助,谢谢!