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


  handleLoad: (e) ->
    @setState loading: false
    @props.onLoad? arguments...

    loading: true
    playing: false
    frame: @props.frame ? 0
  
  componentDidMount: ->
    @refs.videoPlayer?.getDOMNode().addEventListener 'canplaythrough', @handleLoad

  render: ->
    {type, format, src} = getSubjectLocation @props.subject, @state.frame
