Remove the scheme from help videos so that they maintain the scheme of the

calling page
This commit is contained in:
yaur 2015-01-28 18:33:28 -05:00
parent 03093fc4a5
commit 30f9188090

View file

@ -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) ->