Fix bug introduced by fixing #918

This commit is contained in:
Calvin Montgomery 2021-10-17 16:37:57 -07:00
parent 1bab65bb13
commit 7c3f3070f9
2 changed files with 6 additions and 2 deletions

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.82.7", "version": "3.82.8",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },

View File

@ -46,6 +46,10 @@ waitUntilDefined(window, 'videojs', =>
videojs.options.flash.swf = '/video-js.swf' videojs.options.flash.swf = '/video-js.swf'
) )
hasAnyTextTracks = (data) ->
ntracks = data?.meta?.textTracks?.length ? 0
return ntracks > 0
window.VideoJSPlayer = class VideoJSPlayer extends Player window.VideoJSPlayer = class VideoJSPlayer extends Player
constructor: (data) -> constructor: (data) ->
if not (this instanceof VideoJSPlayer) if not (this instanceof VideoJSPlayer)
@ -59,7 +63,7 @@ window.VideoJSPlayer = class VideoJSPlayer extends Player
width: '100%' width: '100%'
height: '100%' height: '100%'
if @mediaType == 'cm' and data.meta.textTracks != null && data.meta.textTracks.length > 0 if @mediaType == 'cm' and hasAnyTextTracks(data)
attrs.crossorigin = 'anonymous' attrs.crossorigin = 'anonymous'
video = $('<video/>') video = $('<video/>')