     if @video.end
       # work in AS3, not HMLT5. but iframe use AS3
       @playerVars.end = @video.end
+
+    # There is a bug which prevents YouTube API to correctly set the speed to 1.0 from another speed
+    # in Firefox when in HTML5 mode. There is a fix which basically reloads the video at speed 1.0
+    # when this change is requested (instead of simply requesting a speed change to 1.0). This has to
+    # be done only when the video is being watched in Firefox. We need to figure out what browser is
+    # currently executing this code.
+    @video.isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1
+
     if @video.videoType is 'html5'
+      @video.playerType = 'browser'
       @player = new HTML5Video.Player @video.el,
         playerVars: @playerVars,
         videoSources: @video.html5Sources,

    if @video.videoType is 'youtube'
      if @video.show_captions is true
        @caption.currentSpeed = newSpeed
    if @video.videoType is 'html5'
      @player.setPlaybackRate newSpeed
    else if @video.videoType is 'youtube'
      if @isPlaying()
        @player.loadVideoById(@video.youtubeId(), @currentTime)
      else
        @player.cueVideoById(@video.youtubeId(), @currentTime)
    if @video.videoType is 'youtube'
      @updatePlayTime @currentTime


        youTubeId = @video.videos['1.0']
      else
        youTubeId = @video.youtubeId()
      @video.playerType = 'youtube'
      @player = new YT.Player @video.id,
        playerVars: @playerVars
        videoId: youTubeId
