Bump browserslist from 4.16.3 to 4.16.6
[KisSync.git] / player / twitchclip.coffee
blob8a4beef02b0986bf3bac5ef4d1e903cdcee1cf88
1 window.TwitchClipPlayer = class TwitchClipPlayer extends EmbedPlayer
2     constructor: (data) ->
3         if not (this instanceof TwitchClipPlayer)
4             return new TwitchClipPlayer(data)
6         @load(data)
8     load: (data) ->
9         if location.hostname != location.host or location.protocol != 'https:'
10             alert = makeAlert(
11                 'Twitch API Parameters',
12                 window.TWITCH_PARAMS_ERROR,
13                 'alert-danger'
14             ).removeClass('col-md-12')
15             removeOld(alert)
16             return
18         data.meta.embed =
19             tag: 'iframe'
20             src: "https://clips.twitch.tv/embed?clip=#{data.id}&parent=#{location.host}"
21         super(data)