File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package io .getstream .models .framework ;
2+
3+ import lombok .Builder ;
4+ import lombok .Getter ;
5+
6+ @ Builder
7+ @ Getter
8+ public class SRTCredentials {
9+ String address ;
10+ }
Original file line number Diff line number Diff line change 22
33import io .getstream .exceptions .StreamException ;
44import io .getstream .models .*;
5+ import io .getstream .models .framework .SRTCredentials ;
56import io .getstream .models .framework .StreamResponse ;
67import org .jetbrains .annotations .NotNull ;
78
@@ -41,7 +42,7 @@ public StreamResponse<GetOrCreateCallResponse> getOrCreate() throws StreamExcept
4142 return this .getOrCreate (new GetOrCreateCallRequest ());
4243 }
4344
44- public String createSRTToken (@ NotNull String userID ) throws StreamException {
45+ public SRTCredentials createSRTCredentials (@ NotNull String userID ) throws StreamException {
4546 if (this .data == null ) {
4647 throw StreamException .build (
4748 "Call object is not initialized, please call get() or getOrCreate() first" );
@@ -51,10 +52,13 @@ public String createSRTToken(@NotNull String userID) throws StreamException {
5152 String [] segments = token .split ("\\ ." );
5253 String passphrase = segments [2 ];
5354
54- return data .getIngress ()
55- .getSrt ()
56- .getAddress ()
57- .replace ("{passphrase}" , passphrase )
58- .replace ("{token}" , token );
55+ return SRTCredentials .builder ()
56+ .address (
57+ data .getIngress ()
58+ .getSrt ()
59+ .getAddress ()
60+ .replace ("{passphrase}" , passphrase )
61+ .replace ("{token}" , token ))
62+ .build ();
5963 }
6064}
You can’t perform that action at this time.
0 commit comments