mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Remove the scheme from help videos so that they maintain the scheme of the
calling page
This commit is contained in:
parent
03093fc4a5
commit
30f9188090
1 changed files with 10 additions and 1 deletions
|
@ -94,9 +94,18 @@ 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 = @helpVideos[@helpVideosIndex].url
|
||||
console.log(@helpVideos[@helpVideosIndex].url)
|
||||
helpVideoURL = fixupUri(@helpVideos[@helpVideosIndex].url)
|
||||
@setupVimeoVideoPlayer helpVideoURL
|
||||
|
||||
setupVimeoVideoPlayer: (helpVideoURL) ->
|
||||
|
|
Loading…
Reference in a new issue