Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.

Add update method to switch the current placeholder and/or video #25

Merged
merged 5 commits into from
Aug 18, 2016

Conversation

i-like-robots
Copy link
Contributor

@i-like-robots i-like-robots commented Aug 15, 2016

screen shot 2016-08-15 at 12 44 00

This adds a new method to instances of o-video that enables the video and/or placeholder to be swapped.

Usage like so:

const video = new Video(options);

select.onchange = function () {
  video.update({ id: this.value });
};

Also fixes some testing trip hazards.

…ure specs have autorender option set to false.
@@ -1,6 +1,18 @@
/* global console */
import './../../main.js';
import OVideo from '../../src/js/video';

document.addEventListener("DOMContentLoaded", function() {
document.dispatchEvent(new CustomEvent('o.DOMContentLoaded'));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't want to dispatch this if your instantiating it manually

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

@i-like-robots i-like-robots force-pushed the matth/update-method branch 2 times, most recently from 17cfe64 to 924fac4 Compare August 15, 2016 13:40
@@ -4,6 +4,8 @@ machine:
post:
- npm install -g Financial-Times/origami-build-tools#node4
dependencies:
pre:
- sudo apt-get update; sudo apt-get install libpango1.0-0 && sudo apt-get install firefox

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth adding -y to apt-get?

@i-like-robots i-like-robots force-pushed the matth/update-method branch 6 times, most recently from da6fbf1 to 6fb1aec Compare August 15, 2016 15:52
@i-like-robots
Copy link
Contributor Author

I reckon we're back to CI stability now =]

});

afterEach(() => {
window.fetch.restore();
HTMLVideoElement.prototype.canPlayType.restore();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like there are indentation issues

@AlbertoElias
Copy link

maybe indentation issues? rest looks good!

@i-like-robots
Copy link
Contributor Author

Oops, fixed =]

@AlbertoElias AlbertoElias merged commit 3c6f869 into master Aug 18, 2016
@AlbertoElias AlbertoElias deleted the matth/update-method branch August 18, 2016 08:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants