-
Notifications
You must be signed in to change notification settings - Fork 468
feat: Add PlaybackGrant #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add PlaybackGrant #574
Conversation
4dcc18f
to
0c95e33
Compare
0c95e33
to
df19c0e
Compare
@shwetha-manvinkurke For this one, I was able to validate that using the PlaybackGrant generated a token I could use to connect
|
|
||
class PlaybackGrant | ||
include AccessTokenGrant | ||
attr_accessor :grant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be too hard to break this up though. Instead of :grant
, you would do something like:
attr_accessor :requestCredentials,
:playbackUrl,
:playbackStreamerSid
end | ||
|
||
def _generate_payload | ||
grant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
payload = {}
payload[:requestCredentials] = requestCredentials if requestCredentials
payload[:playbackUrl] = playbackUrl if playbackUrl
payload[:playbackStreamerSid] = playbackStreamerSid if playbackStreamerSid
@@ -142,6 +142,20 @@ | |||
expect(payload['grants']['task_router']['role']).to eq('worker') | |||
end | |||
|
|||
it 'Playback grant' do | |||
playback_grant = Twilio::JWT::AccessToken::PlaybackGrant.new | |||
grant = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
playback_grant.playbackStreamerSid = "VJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
playback_grant.playbackUrl = "https://000.us-east-1.playback.live-video.net/api/video/v1/us-east-000.channel.000?token=xxxxx"
@scat.add_grant(playback_grant)
Fixes
Add PlaybackGrant.
Checklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.