   setInFlipbookMode: (inFlipbookMode) ->
     @setState {inFlipbookMode}
 
-  setPlaying: (playing) ->
-    @setState {playing}
+  setPlaying: (frame, playing) ->
     if playing
       @nextFrame()
       @_playingInterval = setInterval @nextFrame, @props.playFrameDuration

      when 'image'
        <img className="subject" src={src} style={SUBJECT_STYLE} onLoad={@handleLoad} />
      when 'video'
        <video ref="videoPlayer" src={src} type={"#{type}/#{format}"} onCanPlayThrough={@handleLoad} onEnded={@endVideo} onTimeUpdate={@updateScrubber}>
          Your browser does not support the video format. Please upgrade your browser.
        </video>

    if FrameWrapper
      <FrameWrapper frame={frame} naturalWidth={@state.frameDimensions[src]?.width} naturalHeight={@state.frameDimensions[src]?.height} workflow={@props.workflow} subject={@props.subject} classification={@props.classification} annotation={@props.annotation}>

    playbackRate: 1
    frameDimensions: {}
    inFlipbookMode: @props.allowFlipbook
    videoStates: []

  componentDidMount: ->
    for frame of @props.subject.locations
      @refs['videoScrubber'+frame]?.value = 0

  componentDidUpdate: ->
    for frame of @props.subject.locations
      @refs['videoPlayer'+frame].playbackRate = @state.videoStates[frame]?.playbackRate || 1

  willReceiveProps: (nextProps) ->
    # The default state for subjects is flipbook if allowed
