You can rewrite `jasmine.stubYoutubePlayer` so:
```coffee
jasmine.getMockedYoutubePlayer = ->
    Player = jasmine.createSpyObj 'YT.Player', ['cueVideoById', 'getVideoEmbedCode','getDuration',
    'getCurrentTime', 'getPlayerState', 'getVolume', 'setVolume', 'loadVideoById', 'getAvailablePlaybackRates',
    'playVideo', 'pauseVideo', 'seekTo', 'getDuration', 'getAvailablePlaybackRates', 'setPlaybackRate']
    Player.getDuration.andReturn 60
    Player.getAvailablePlaybackRates.andReturn ['0.5', '1.0', '1.5', '2.0']
    Player
```
and use it here:
```coffee
window.YT =
    Player: jasmine.getMockedYoutubePlayer()
```