1 window.VimeoPlayer = class VimeoPlayer extends Player
3 if not (this instanceof VimeoPlayer)
4 return new VimeoPlayer(data)
9 @setMediaProperties(data)
11 waitUntilDefined(window, 'Vimeo', =>
12 video = $('<iframe/>')
15 src: "https://player.vimeo.com/video/#{data.id}"
16 webkitallowfullscreen: true
17 mozallowfullscreen: true
21 if USEROPTS.wmode_transparent
22 video.attr('wmode', 'transparent')
24 @vimeo = new Vimeo.Player(video[0])
28 socket.emit('playNext')
50 @vimeo.play().catch((error) ->
51 console.error('vimeo::play():', error)
57 @vimeo.pause().catch((error) ->
58 console.error('vimeo::pause():', error)
63 @vimeo.setCurrentTime(time).catch((error) ->
64 console.error('vimeo::setCurrentTime():', error)
67 setVolume: (volume) ->
69 @vimeo.setVolume(volume).catch((error) ->
70 console.error('vimeo::setVolume():', error)
75 @vimeo.getCurrentTime().then((time) ->
78 console.error('vimeo::getCurrentTime():', error)
85 @vimeo.getVolume().then((volume) ->
86 cb(parseFloat(volume))
88 console.error('vimeo::getVolume():', error)