Fix some drive userscript issues
This commit is contained in:
parent
7c3f2d0a8b
commit
d0d2002a5f
6 changed files with 79 additions and 43 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue