mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Fix help video events
Removing the protocol broke the video player event hooks.
This commit is contained in:
parent
5addacddf0
commit
92f070ecca
1 changed files with 6 additions and 11 deletions
|
@ -94,18 +94,13 @@ module.exports = class LevelGuideView extends CocoView
|
|||
window.tracker?.trackEvent 'Finish help video', level: @levelID, ls: @sessionID, style: @helpVideos[@helpVideosIndex].style
|
||||
@trackedHelpVideoFinish = true
|
||||
|
||||
# we wan't to always use the same scheme (HTTP/HTTPS) as the page was loaded with, but don't want to require Artisans to have to remember
|
||||
# not to include a scheme in help video url
|
||||
fixupUri = (uri) ->
|
||||
n = uri.indexOf('/')
|
||||
if n < 1
|
||||
return uri
|
||||
return uri.slice(n)
|
||||
|
||||
setupVideoPlayer: () ->
|
||||
return unless @helpVideos.length > 0
|
||||
helpVideoURL = fixupUri(@helpVideos[@helpVideosIndex].url)
|
||||
@setupVimeoVideoPlayer helpVideoURL
|
||||
return unless @helpVideos?.length > 0
|
||||
return unless url = @helpVideos[@helpVideosIndex]?.url
|
||||
# Always use HTTPS
|
||||
# TODO: Not specifying the protocol should work based on Vimeo docs, but breaks postMessage/eventing in practice.
|
||||
url = "https:" + url.substr url.indexOf '/'
|
||||
@setupVimeoVideoPlayer url
|
||||
|
||||
setupVimeoVideoPlayer: (helpVideoURL) ->
|
||||
# Setup Vimeo player
|
||||
|
|
Loading…
Add table
Reference in a new issue