This repository has been archived by the owner on Nov 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Financial-Times/matth/update-method
Add update method to switch the current placeholder and/or video
- Loading branch information
Showing
12 changed files
with
372 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
/* global console */ | ||
import './../../main.js'; | ||
import OVideo from '../../src/js/video'; | ||
|
||
document.addEventListener("DOMContentLoaded", function() { | ||
document.dispatchEvent(new CustomEvent('o.DOMContentLoaded')); | ||
const video = new OVideo(document.querySelector('[data-o-component="o-video"]')); | ||
|
||
const select = document.querySelector('select'); | ||
|
||
if (select) { | ||
select.addEventListener('change', function () { | ||
video.update({ id: this.value }); | ||
}); | ||
|
||
select.value = video.opts.id; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
{ | ||
|
||
"id": 4907997821001, | ||
"name": "Austrian far-right candidate narrowly defeated", | ||
"adKeys": null, | ||
"shortDescription": "Right-winger Norbert Hofer was edged out in a tight presidential race. The FT reports", | ||
"longDescription": "The Austrian Freedom party candidate Norbert Hofer lost to Alexander Van der Bellen, a Green politician who ran as an independent. The result was welcomed by those worried about the emergence of a far-right head of state in a European country. The FT's Ralph Atkins reports from Vienna.", | ||
"creationDate": "1464038093344", | ||
"publishedDate": "1464038243341", | ||
"lastModifiedDate": "1464124438800", | ||
"tags": [ | ||
"section:world", | ||
"Norbert Hofer", | ||
"Austrian election", | ||
"Austria", | ||
"brand:FT World", | ||
"austrian freedom party", | ||
"Alexander van der Bellen" | ||
], | ||
"videoStillURL": "https://bcsecure01-a.akamaihd.net/13/47628783001/201605/227/47628783001_4908536547001_MAS-FT-World-Norbert-Hofer.jpg?pubId=47628783001", | ||
"referenceId": null, | ||
"length": 156735, | ||
"economics": "AD_SUPPORTED", | ||
"itemState": "ACTIVE", | ||
"playsTotal": 1553, | ||
"playsTrailingWeek": 3, | ||
"version": 37, | ||
"cuePoints": [ | ||
{ | ||
"forceStop": false, | ||
"id": 4906502619001, | ||
"metadata": null, | ||
"name": "Pre-roll", | ||
"time": 0, | ||
"type": 0, | ||
"typeEnum": "AD", | ||
"videoId": 4907997821001 | ||
} | ||
], | ||
"customFields": { | ||
"byline": "Produced by Gregory Bobillot. Footage: Getty" | ||
}, | ||
"HLSURL": "http://c.brightcove.com/services/mobile/streaming/index/master.m3u8?videoId=4907997821001&pubId=47628783001", | ||
"renditions": [ | ||
{ | ||
"audioOnly": false, | ||
"controllerType": "DEFAULT", | ||
"displayName": "47628783001_4908185652001_4907997821001_1_1.mp4", | ||
"encodingRate": 129876, | ||
"frameHeight": 224, | ||
"frameWidth": 400, | ||
"id": 4908307801001, | ||
"referenceId": null, | ||
"remoteStreamName": null, | ||
"remoteUrl": null, | ||
"size": 2609217, | ||
"uploadTimestampMillis": 1464045034838, | ||
"url": "http://uds.ak.o.brightcove.com/47628783001/47628783001_4908307801001_4907997821001.mp4", | ||
"videoCodec": "H264", | ||
"videoContainer": "MP4", | ||
"videoDuration": 156800 | ||
}, | ||
{ | ||
"audioOnly": false, | ||
"controllerType": "DEFAULT", | ||
"displayName": "47628783001_4908185652001_4907997821001_1_1.mp4", | ||
"encodingRate": 480398, | ||
"frameHeight": 268, | ||
"frameWidth": 480, | ||
"id": 4908307965001, | ||
"referenceId": null, | ||
"remoteStreamName": null, | ||
"remoteUrl": null, | ||
"size": 9408160, | ||
"uploadTimestampMillis": 1464045067293, | ||
"url": "http://uds.ak.o.brightcove.com/47628783001/47628783001_4908307965001_4907997821001.mp4", | ||
"videoCodec": "H264", | ||
"videoContainer": "MP4", | ||
"videoDuration": 156735 | ||
}, | ||
{ | ||
"audioOnly": false, | ||
"controllerType": "DEFAULT", | ||
"displayName": "47628783001_4908185652001_4907997821001_1_1.mp4", | ||
"encodingRate": 776000, | ||
"frameHeight": 360, | ||
"frameWidth": 640, | ||
"id": 4908307914001, | ||
"referenceId": null, | ||
"remoteStreamName": null, | ||
"remoteUrl": null, | ||
"size": 15105430, | ||
"uploadTimestampMillis": 1464045039918, | ||
"url": "http://uds.ak.o.brightcove.com/47628783001/47628783001_4908307914001_4907997821001.mp4", | ||
"videoCodec": "H264", | ||
"videoContainer": "MP4", | ||
"videoDuration": 156735 | ||
}, | ||
{ | ||
"audioOnly": false, | ||
"controllerType": "DEFAULT", | ||
"displayName": "47628783001_4908185652001_4907997821001_1_1.mp4", | ||
"encodingRate": 301884, | ||
"frameHeight": 224, | ||
"frameWidth": 400, | ||
"id": 4908307967001, | ||
"referenceId": null, | ||
"remoteStreamName": null, | ||
"remoteUrl": null, | ||
"size": 5963907, | ||
"uploadTimestampMillis": 1464045071746, | ||
"url": "http://uds.ak.o.brightcove.com/47628783001/47628783001_4908307967001_4907997821001.mp4", | ||
"videoCodec": "H264", | ||
"videoContainer": "MP4", | ||
"videoDuration": 156735 | ||
}, | ||
{ | ||
"audioOnly": false, | ||
"controllerType": "DEFAULT", | ||
"displayName": "47628783001_4908185652001_4907997821001_1_1.mp4", | ||
"encodingRate": 1171495, | ||
"frameHeight": 404, | ||
"frameWidth": 720, | ||
"id": 4908307939001, | ||
"referenceId": null, | ||
"remoteStreamName": null, | ||
"remoteUrl": null, | ||
"size": 22714998, | ||
"uploadTimestampMillis": 1464045050114, | ||
"url": "http://uds.ak.o.brightcove.com/47628783001/47628783001_4908307939001_4907997821001.mp4", | ||
"videoCodec": "H264", | ||
"videoContainer": "MP4", | ||
"videoDuration": 156735 | ||
}, | ||
{ | ||
"audioOnly": false, | ||
"controllerType": "DEFAULT", | ||
"displayName": "47628783001_4908185652001_4907997821001_1_1.mp4", | ||
"encodingRate": 1771495, | ||
"frameHeight": 720, | ||
"frameWidth": 1280, | ||
"id": 4908307961001, | ||
"referenceId": null, | ||
"remoteStreamName": null, | ||
"remoteUrl": null, | ||
"size": 34119363, | ||
"uploadTimestampMillis": 1464045065259, | ||
"url": "http://uds.ak.o.brightcove.com/47628783001/47628783001_4908307961001_4907997821001.mp4", | ||
"videoCodec": "H264", | ||
"videoContainer": "MP4", | ||
"videoDuration": 156735 | ||
} | ||
], | ||
"geoFiltered": false, | ||
"geoRestricted": false, | ||
"videoStill": { | ||
"displayName": "MAS_FT-World_Norbert-Hofer.jpg", | ||
"id": 4908536547001, | ||
"referenceId": null, | ||
"remoteUrl": null, | ||
"type": "VIDEO_STILL" | ||
}, | ||
"captioning": null | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.