package Ġde . nic id ien ase . chaos flix . touch . playback Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . v 7 . app . AppCompatActivity Ċ import Ġandroid . view . MenuItem Ċ import Ġde . nic id ien ase . chaos flix . R Ċ import Ġde . nic id ien ase . chaos flix . common . entities . recording . persistence . Persistent Event Ċ import Ġde . nic id ien ase . chaos flix . common . entities . recording . persistence . Persistent Recording Ċ import Ġde . nic id ien ase . chaos flix . common . entities . streaming . Live Conference Ċ import Ġde . nic id ien ase . chaos flix . common . entities . streaming . Room Ċ import Ġde . nic id ien ase . chaos flix . common . entities . streaming . Stream Ċ import Ġde . nic id ien ase . chaos flix . common . entities . streaming . Stream Url Ċ import Ġde . nic id ien ase . chaos flix . touch . browse . streaming . Streaming Item Ċ Ċ class ĠPlayer Activity Ġ: ĠAppCompatActivity (), ĠEx o Player Fragment . On MediaPlayer Interaction Listener Ġ{ ĊĊ ĉ override Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ Ċĉ ĉ super . onCreate ( savedInstanceState ) Ċĉ ĉ set ContentView ( R . layout . activity _ player ) ĊĊĉ ĉ if Ġ( savedInstanceState Ġ== Ġnull Ġ&& Ġintent . extras Ġ!= Ġnull ) Ġ{ Ċĉĉ ĉ val ĠcontentType Ġ= Ġintent . getString Extra ( CONTENT _ TYPE ) Ċĉĉ ĉ var Ġplayback Item Ġ= ĠPlay back Item (" Empty ", Ġ" Empty ", Ġ 0 , Ġ"") Ċĉĉ ĉ if Ġ( contentType . equals ( CONTENT _ RECORD ING )) Ġ{ Ċĉĉĉ ĉ val Ġevent Ġ= Ġintent . extras . get Parcelable < Persistent Event >( EVENT _ KEY ) Ċĉĉĉ ĉ val Ġrecording Ġ= Ġintent . extras . get Parcelable < Persistent Recording >( RECORD ING _ KEY ) Ċĉĉĉ ĉ val Ġrecording Uri Ġ= Ġintent . extras . getString ( OFF LINE _ URI ) Ċĉĉĉ ĉ playback Item Ġ= ĠPlay back Item ( Ċĉĉĉĉĉ ĉ event ?. title Ġ?: Ġ"", Ċĉĉĉĉĉ ĉ event ?. subtitle Ġ?: Ġ"", Ċĉĉĉĉĉ ĉ event ?. eventId Ġ?: Ġ 0 , Ċĉĉĉĉĉ ĉ recording Uri Ġ?: Ġrecording ?. recording Url Ġ?: Ġ"") Ċĉĉ ĉ } Ġelse Ġif Ġ( contentType . equals ( CONTENT _ STREAM )) Ġ{ Ċĉĉĉ ĉ // ĠTODO Ġimplement ĠPlayer Ġfor ĠStream Ċĉĉĉ ĉ val Ġconference Ġ= Ġintent . extras . getString ( CON FER ENCE ," ") Ċĉĉĉ ĉ val Ġroom Ġ= Ġintent . extras . getString ( ROOM ," ") Ċĉĉĉ ĉ val Ġstream Ġ= Ġintent . extras . getString ( STREAM , Ġ"") Ċĉĉĉ ĉ playback Item Ġ= ĠPlay back Item ( conference , room , 0 , Ġstream ) Ċĉĉ ĉ } ĊĊĉĉ ĉ val Ġft Ġ= Ġsupport FragmentManager . beginTransaction () Ċĉĉ ĉ val Ġplayer Fragment Ġ= ĠEx o Player Fragment . newInstance ( playback Item ) Ċĉĉ ĉ ft . replace ( R . id . fragment _ container , Ġplayer Fragment ) Ċĉĉ ĉ ft . commit () Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Options ItemSelected ( item : ĠMenuItem ?): ĠBoolean Ġ{ Ċĉ ĉ if Ġ( item ?. itemId Ġ== Ġandroid . R . id . home ) Ġ{ Ċĉĉ ĉ finish () Ċĉĉ ĉ return Ġtrue Ċĉ ĉ } Ċĉ ĉ return Ġsuper . on Options ItemSelected ( item ) Ċ ĉ } ĊĊ ĉ comp anion Ġobject Ġ{ Ċĉ ĉ val ĠCONTENT _ TYPE Ġ= Ġ" content " Ċĉ ĉ val ĠCONTENT _ RECORD ING Ġ= Ġ" content _ recording " Ċĉ ĉ val ĠCONTENT _ STREAM Ġ= Ġ" content _ stream " ĊĊĉ ĉ val ĠEVENT _ KEY Ġ= Ġ" event " Ċĉ ĉ val ĠREC ORD ING _ KEY Ġ= Ġ" recording " Ċĉ ĉ val ĠCON FER ENCE Ġ= Ġ" live _ con fer ences " Ċĉ ĉ val ĠRO OM Ġ= Ġ" room " Ċĉ ĉ val ĠST REAM Ġ= Ġ" stream " ĊĊĉ ĉ val ĠOFF LINE _ URI Ġ= Ġ" recording _ uri " ĊĊĉ ĉ fun Ġlaunch ( context : ĠContext , Ġevent : ĠPersistent Event , Ġuri : ĠString ) Ġ{ Ċĉĉ ĉ val Ġi Ġ= ĠIntent ( context , ĠPlayer Activity :: class . java ) Ċĉĉ ĉ i . putExtra ( CONTENT _ TYPE , ĠCONTENT _ RECORD ING ) Ċĉĉ ĉ i . putExtra ( Player Activity . EVENT _ KEY , Ġevent ) Ċĉĉ ĉ i . putExtra ( Player Activity . OFF LINE _ URI , Ġuri ) Ċĉĉ ĉ context . startActivity ( i ) Ċĉ ĉ } ĊĊĉ ĉ fun Ġlaunch ( context : ĠContext , Ġevent : ĠPersistent Event , Ġrecording : ĠPersistent Recording ) Ġ{ Ċĉĉ ĉ val Ġi Ġ= ĠIntent ( context , ĠPlayer Activity :: class . java ) Ċĉĉ ĉ i . putExtra ( CONTENT _ TYPE , ĠCONTENT _ RECORD ING ) Ċĉĉ ĉ i . putExtra ( Player Activity . EVENT _ KEY , Ġevent ) Ċĉĉ ĉ i . putExtra ( Player Activity . RECORD ING _ KEY , Ġrecording ) Ċĉĉ ĉ context . startActivity ( i ) Ċĉ ĉ } ĊĊĉ ĉ fun Ġlaunch ( context : ĠContext , Ġconference : ĠString , Ġroom : ĠString , Ġstream : ĠStream Url ) Ġ{ Ċĉĉ ĉ val Ġi Ġ= ĠIntent ( context , ĠPlayer Activity :: class . java ) Ċĉĉ ĉ i . putExtra ( CONTENT _ TYPE , ĠCONTENT _ STREAM ) Ċĉĉ ĉ i . putExtra ( CON FER ENCE , Ġconference ) Ċĉĉ ĉ i . putExtra ( ROOM , Ġroom ) Ċĉĉ ĉ i . putExtra ( STREAM , Ġstream . url ) Ċĉĉ ĉ context . startActivity ( i ) Ċĉ ĉ } Ċ ĉ } Ċ Ċ } Ċ