package Ġvideo . api . react native . li vest ream Ċ Ċ import Ġcom . facebook . react . bridge . Readable Array Ċ import Ġcom . facebook . react . bridge . Readable Map Ċ import Ġcom . facebook . react . u im an ager . Simple View Manager Ċ import Ġcom . facebook . react . u im an ager . The med React Context Ċ import Ġcom . facebook . react . u im an ager . annotations . React Prop Ċ import Ġvideo . api . react native . li vest ream . utils . get Camera Facing Ċ import Ġvideo . api . react native . li vest ream . utils . to Audio Config Ċ import Ġvideo . api . react native . li vest ream . utils . to Video Config ĊĊ Ċ class ĠReact Native Live Stream View Manager Ġ: ĠSimple View Manager < React Native Live Stream View >() Ġ{ ĊĠ Ġoverride Ġfun ĠgetName () Ġ= Ġ" React Native Live Stream View " ĊĊĠ Ġoverride Ġfun Ġcreate View Instance ( react Context : ĠThe med React Context ): ĠReact Native Live Stream View Ġ{ ĊĠĠĠ Ġreturn ĠReact Native Live Stream View ( react Context ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġreceive Command ( ĊĠĠĠ Ġview : ĠReact Native Live Stream View , ĊĠĠĠ Ġcommand Id : ĠInt , ĊĠĠĠ Ġargs : ĠRead able Array ? ĊĠ Ġ) Ġ{ ĊĠĠĠ Ġsuper . receive Command ( view , Ġcommand Id , Ġargs ) ĊĊĠĠĠ Ġwhen Ġ( command Id ) Ġ{ ĊĠĠĠĠĠ ĠView Props . Commands . START _ STREAM ING . ordinal Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠrequestId Ġ= Ġargs !!. getInt ( 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġstream Key Ġ= Ġargs . getString ( 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġurl Ġ= Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġargs . getString ( 2 ) ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġview . start Streaming ( requestId , Ġstream Key , Ġurl ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ ĠView Props . Commands . STOP _ STREAM ING . ordinal Ġ-> Ġview . stop Streaming () ĊĠĠĠĠĠ Ġelse Ġ-> Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠIllegalArgumentException (" Unsupported Ġcommand Ġ% d Ġreceived Ġby Ġ% s . Ġ$ command Id ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Commands Map (): ĠMap < String , ĠInt > Ġ{ ĊĠĠĠ Ġreturn ĠView Props . Commands . to Commands Map () ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Exported Custom Direct EventType Constants (): ĠMap < String , Ġ*> Ġ{ ĊĠĠĠ Ġreturn ĠView Props . Events . to Events Map () ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= ĠView Props . VIDEO _ CONFIG ) ĊĠ Ġfun Ġset Video Config ( view : ĠReact Native Live Stream View , Ġvideo Map : ĠRead able Map ) Ġ{ ĊĠĠĠ Ġif Ġ( view . is Streaming ) Ġ{ ĊĠĠĠĠĠ Ġview . video Bit rate Ġ= Ġvideo Map . getInt ( View Props . BIT RATE ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġview . video Config Ġ= Ġvideo Map . to Video Config () ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= ĠView Props . AUDIO _ CONFIG ) ĊĠ Ġfun Ġset Audio Config ( view : ĠReact Native Live Stream View , Ġaudio Map : ĠRead able Map ) Ġ{ ĊĠĠĠ Ġview . audio Config Ġ= Ġaudio Map . to Audio Config () ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= ĠView Props . CAMERA ) ĊĠ Ġfun Ġset Camera ( view : ĠReact Native Live Stream View , Ġnew Video Camera String : ĠString ) Ġ{ ĊĠĠĠ Ġview . camera Ġ= Ġnew Video Camera String . get Camera Facing () ĊĠ Ġ} ĊĊĠ Ġ@ React Prop ( name Ġ= ĠView Props . IS _ MUT ED ) ĊĠ Ġfun Ġis Mut ed ( view : ĠReact Native Live Stream View , Ġis Mut ed : ĠBoolean ) Ġ{ ĊĠĠĠ Ġview . is Mut ed Ġ= Ġis Mut ed ĊĠ Ġ} Ċ } Ċ