public void play ( String name , int start , int length , Object reset ) { if ( reset instanceof Boolean ) { play ( name , start , length , ( ( Boolean ) reset ) . booleanValue ( ) ) ; } else { if ( reset instanceof Integer ) { int value = ( Integer ) reset ; switch ( value ) { case 0 : //adds the stream to a playlist IStreamCapableConnection streamConn = ( IStreamCapableConnection ) Red5 . getConnectionLocal ( ) ; IPlaylistSubscriberStream playlistStream = ( IPlaylistSubscriberStream ) streamConn . getStreamById ( streamConn . getStreamId ( ) ) ; IPlayItem item = SimplePlayItem . build ( name ) ; playlistStream . addItem ( item ) ; play ( name , start , length , false ) ; break ; case 2 : //maintains the playlist and returns all stream messages at once, rather than at intervals break ; case 3 : //clears the playlist and returns all stream messages at once break ; default : //clears any previous play calls and plays name immediately play ( name , start , length , true ) ; } } else { play ( name , start , length ) ; } } }
Plays back a stream based on the supplied name from the specified position for the given length of time .