()
| 4 | export default class Wistia extends Media { |
| 5 | |
| 6 | _loadMedia() { |
| 7 | var api_url, |
| 8 | self = this; |
| 9 | |
| 10 | // Create Dom element |
| 11 | this._el.content_item = this.domCreate("div", "tl-media-item tl-media-iframe tl-media-wistia tl-media-shadow", this._el.content); |
| 12 | |
| 13 | // Get Media ID |
| 14 | this.media_id = this.data.url.split(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/medias\/(.*)/)[3]; |
| 15 | trace(`Wistia: media_id: ${this.media_id}`) |
| 16 | // API URL |
| 17 | api_url = "https://fast.wistia.com/embed/iframe/" + this.media_id + "?version=v1&controlsVisibleOnLoad=true&playerColor=aae3d8"; |
| 18 | |
| 19 | this.player = this.domCreate("iframe", "", this._el.content_item); |
| 20 | |
| 21 | // Media Loaded Event |
| 22 | this.player.addEventListener('load', function(e) { |
| 23 | self.onMediaLoaded(); |
| 24 | }); |
| 25 | |
| 26 | this.player.width = "100%"; |
| 27 | this.player.height = "100%"; |
| 28 | this.player.frameBorder = "0"; |
| 29 | this.player.src = api_url; |
| 30 | |
| 31 | this.player.setAttribute('allowfullscreen', ''); |
| 32 | this.player.setAttribute('webkitallowfullscreen', ''); |
| 33 | this.player.setAttribute('mozallowfullscreen', ''); |
| 34 | |
| 35 | // After Loaded |
| 36 | this.onLoaded(); |
| 37 | } |
| 38 | |
| 39 | // Update Media Display |
| 40 | _updateMediaDisplay() { |
nothing calls this directly
no test coverage detected