 
       else # live
         @startPlaying()
-        @respondPlay requestCommand, callback, @stream.id
+        @respondPlay requestCommand, callback, @stream?.id
 
   closeStream: (callback) ->
     @isPlaying = false

    if doPause # playing -> pause
      @isPlaying = false
      @isWaitingForKeyFrame = false
      if @stream.type is avstreams.STREAM_TYPE_RECORDED
        @stream.pause?()
        logger.info "[rtmp:client=#{@clientid}] stream #{@stream.id} paused at #{msec / 1000} sec (client player time)"



    @lastSentTimestamp = null

    if @stream?.type is avstreams.STREAM_TYPE_RECORDED
      clearQueuedRTMPMessages @stream
      _isPlaying = @isPlaying
      @isPlaying = false
