Fix some drive userscript issues

This commit is contained in:
Calvin Montgomery 2016-10-07 19:55:41 -07:00
parent 7c3f2d0a8b
commit d0d2002a5f
6 changed files with 79 additions and 43 deletions

View file

@ -6,13 +6,14 @@ window.GoogleDrivePlayer = class GoogleDrivePlayer extends VideoJSPlayer
super(data)
load: (data) ->
window.maybePromptToUpgradeUserscript()
if typeof window.getGoogleDriveMetadata is 'function'
window.getGoogleDriveMetadata(data.id, (error, metadata) =>
if error
console.error(error)
alertBox = window.document.createElement('div')
alertBox.className = 'alert alert-danger'
alertBox.textContent = error.message
alertBox.textContent = error
document.getElementById('ytapiplayer').appendChild(alertBox)
else
data.meta.direct = metadata.videoMap