Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into FLUID-4649

Conflicts:
	html/videoPlayer_template.html
  • Loading branch information...
commit 6ce5f0086d174225024cce4519b7f238230ba161 2 parents 2eba8fb + 93b5b3a
@acheetham acheetham authored
View
2  html/videoPlayer_template.html
@@ -12,7 +12,7 @@
<div class="fl-videoPlayer-controller-buttons-main">
<button type="button" class="flc-videoPlayer-play fl-videoPlayer-button"></button>
- <div class="flc-videoPlayer-volumeContainer fl-videoPlayer-volumeContainer" title="Volume controls. Use up and down arrows to adjust volume, space or enter to mute">
+ <div class="flc-videoPlayer-volumeContainer fl-videoPlayer-volumeContainer">
<button type="button" class="flc-videoPlayer-mute fl-videoPlayer-button"></button>
<div class="flc-videoPlayer-volumeControl"></div>
</div>
View
4 js/MenuButton.js
@@ -230,6 +230,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
finalInitFunction: "fluid.videoPlayer.languageControls.finalInit",
selectors: {
button: ".flc-videoPlayer-languageButton",
+ label: ".flc-videoPlayer-languageButton-label",
menu: ".flc-videoPlayer-languageMenu"
},
events: {
@@ -259,7 +260,8 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
pressed: "{languageControls}.options.styles.button"
},
selectors: {
- button: "{languageControls}.options.selectors.button"
+ button: "{languageControls}.options.selectors.button",
+ label: "{languageControls}.options.selectors.label"
},
strings: "{languageControls}.options.strings"
}
View
7 js/ToggleButton.js
@@ -26,7 +26,8 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
onReady: null
},
selectors: { // Integrators may override this selector
- button: ".flc-videoPlayer-button"
+ button: ".flc-videoPlayer-button",
+ label: ".flc-videoPlayer-button-label"
},
styles: {
init: "fl-videoPlayer-button-init",
@@ -80,7 +81,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
}
button.attr("aria-pressed", pressed);
- that.tooltip.updateContent(that.tooltipContentFunction(that));
+ var labelText = that.tooltipContentFunction(that);
+ that.locate("button").attr("aria-label", labelText);
+ that.tooltip.updateContent(labelText);
};
that.press = function () {
View
3  js/VideoPlayer.js
@@ -541,12 +541,13 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
that.container.append(res[key].resourceText);
that.refreshView();
var video = that.locate("video");
- video.attr("aria-label", that.options.strings.videoTitlePreface + that.options.videoTitle);
// Setting the width and height attributes to respect the CSS API for setting the size of the video
// This is required for cross browser sizing of the video
video.attr("width", video.css("width"));
video.attr("height", video.css("height"));
+ that.locate("videoContainer").attr("aria-label", that.options.strings.videoTitlePreface + that.options.videoTitle);
+
bindVideoPlayerDOMEvents(that);
//create all the listeners to the model
bindVideoPlayerModel(that);
View
24 js/VideoPlayer_controllers.js
@@ -71,6 +71,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
currentLanguagePath: "currentTracks.captions",
selectors: {
button: ".flc-videoPlayer-captions-button",
+ label: ".flc-videoPlayer-captions-label",
menu: ".flc-videoPlayer-captions-languageMenu"
},
styles: {
@@ -99,6 +100,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
currentLanguagePath: "currentTracks.transcripts",
selectors: {
button: ".flc-videoPlayer-transcripts-button",
+ label: ".flc-videoPlayer-transcripts-label",
menu: ".flc-videoPlayer-transcripts-languageMenu"
},
styles: {
@@ -121,7 +123,8 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
container: "{controllers}.container",
options: {
selectors: {
- button: ".flc-videoPlayer-play"
+ button: ".flc-videoPlayer-play",
+ label: ".flc-videoPlayer-play-label"
},
styles: {
init: "fl-videoPlayer-play",
@@ -143,7 +146,8 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
container: "{controllers}.container",
options: {
selectors: {
- button: ".flc-videoPlayer-fullscreen"
+ button: ".flc-videoPlayer-fullscreen",
+ label: ".flc-videoPlayer-fullscreen-label"
},
styles: {
init: "fl-videoPlayer-fullscreen",
@@ -461,6 +465,8 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
fluid.videoPlayer.volumeControls.init = function (that) {
var volumeControl = that.locate("volumeControl");
+ var mute = that.locate("mute");
+
volumeControl.addClass(that.options.styles.volumeControl);
volumeControl.slider({
orientation: "vertical",
@@ -469,8 +475,10 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
max: that.model.maxVolume,
value: that.model.volume
});
+ var handle = that.locate("handle");
+
// TODO: This in inherited. Do we need to add aria to sliders ourselves?
- that.locate("handle").attr({
+ handle.attr({
"aria-label": that.options.strings.volume,
"aria-valuemin": that.model.minVolume,
"aria-valuemax": that.model.maxVolume,
@@ -480,9 +488,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
});
fluid.tabindex(that.container, 0);
- fluid.tabindex(that.locate("mute"), -1);
+ fluid.tabindex(mute, -1);
fluid.tabindex(volumeControl, -1);
- fluid.tabindex(that.locate("handle"), -1);
+ fluid.tabindex(handle, -1);
fluid.activatable(that.container, function (evt) {
that.muteButton.press();
@@ -501,6 +509,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
}
}]
});
+
+ that.container.attr("aria-label", that.options.strings.instructions);
+ mute.attr("title", that.options.strings.instructions);
};
fluid.defaults("fluid.videoPlayer.volumeControls", {
@@ -529,7 +540,8 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
},
// TODO: Strings should be moved out into a single top-level bundle (FLUID-4590)
strings: {
- volume: "Volume"
+ volume: "Volume",
+ instructions: "Volume controls. Use up and down arrows to adjust volume, space or enter to mute."
},
components: {
muteButton: {
View
6 tests/js/MenuButtonTests.js
@@ -177,9 +177,10 @@ fluid.registerNamespace("fluid.tests");
listeners: {
onReady: {
listener: function (that) {
- jqUnit.expect(8);
+ jqUnit.expect(10);
var langList = that.menu.locate("language");
var showHide = $(that.menu.locate("showHide")[0]);
+ var button = that.locate("button");
var verifyLanguageState = function (expectedShowText, expectedShowHideFlag) {
jqUnit.expect(2);
jqUnit.assertEquals("The 'show language' model flag should be " + expectedShowHideFlag, expectedShowHideFlag, fluid.get(that.model, that.options.showHidePath));
@@ -190,10 +191,11 @@ fluid.registerNamespace("fluid.tests");
jqUnit.notVisible("Menu should not be visible initially", that.menu.container);
verifyLanguageState(that.options.strings.showLanguage, false);
- var button = $(that.locate("button")[0]);
+ jqUnit.assertEquals("Button should have default aria-label", that.button.options.strings.press, button.attr("aria-label"));
button.click();
jqUnit.isVisible("Clicking the button should show menu", that.menu.container);
jqUnit.assertTrue("Buttons state should be released", that.button.model.pressed);
+ jqUnit.assertEquals("Button should have pressed aria-label", that.button.options.strings.release, button.attr("aria-label"));
button.click();
jqUnit.notVisible("Clicking the button again should hide menu again", that.menu.container);
View
3  tests/js/TestUtils.js
@@ -92,11 +92,12 @@ fluid.registerNamespace("fluid.testUtils");
};
fluid.testUtils.verifyBasicButtonFunctions = function (buttonEl, name, tooltipReleased, tooltipPressed, stylePressed) {
- jqUnit.expect(12);
+ jqUnit.expect(13);
jqUnit.assertEquals("There should be exactly one " + name + " button", 1, buttonEl.length);
jqUnit.assertEquals(name + " button should have role of 'button'", "button", buttonEl.attr("role"));
jqUnit.assertEquals(name + " button should have aria-pressed of 'false' initially", "false", buttonEl.attr("aria-pressed"));
jqUnit.assertFalse(name + " button should not have the 'pressed' style", buttonEl.hasClass(stylePressed));
+ jqUnit.assertEquals(name + " button should have correct aria-label", tooltipReleased, buttonEl.attr("aria-label"));
var tooltip = fluid.testUtils.getTooltipCheckString(buttonEl, tooltipReleased);
var tooltipID = buttonEl.attr("aria-describedby");
View
15 tests/js/ToggleButtonTests.js
@@ -159,5 +159,20 @@ fluid.registerNamespace("fluid.tests");
});
});
+ toggleButtonTests.asyncTest("Label text", function () {
+ jqUnit.expect(2);
+ fluid.tests.initToggleButton({
+ listeners: {
+ onReady: function (that) {
+ jqUnit.assertEquals("Content should contain press label text", that.options.strings.press, that.locate("button").attr("aria-label"));
+ that.locate("button").click();
+ },
+ onPress: function (that) {
+ jqUnit.assertEquals("Content should contain release label text", that.options.strings.release, that.locate("button").attr("aria-label"));
+ start();
+ }
+ }
+ });
+ });
});
})(jQuery);
View
4 tests/js/VideoPlayerControlsTests.js
@@ -37,7 +37,7 @@ fluid.registerNamespace("fluid.tests");
});
videoPlayerControlsTests.asyncTest("Volume controls", function () {
- jqUnit.expect(5);
+ jqUnit.expect(7);
var checkSlider = function (ariavaluenow, expectedValue) {
jqUnit.assertEquals("The slider button should have valuenow of " + expectedValue, expectedValue, ariavaluenow);
},
@@ -52,6 +52,8 @@ fluid.registerNamespace("fluid.tests");
volumeSlider = that.locate("volumeControl"),
sliderHandle = that.locate("handle");
+ jqUnit.assertEquals("Mute button should have title", that.options.strings.instructions, muteButton.attr("title"));
+ jqUnit.assertEquals("Volume container should have aria-label", that.options.strings.instructions, that.container.attr("aria-label"));
checkTooltipOnHover(volumeSlider, "Volume");
checkTooltipOnHover(muteButton, "Mute");
muteButton.click();
View
2  tests/js/VideoPlayerTests.js
@@ -135,7 +135,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
var testVideoLabel = function (vp, expectedLabel) {
jqUnit.expect(1);
- jqUnit.assertEquals("aria-label should be set properly", vp.options.strings.videoTitlePreface + expectedLabel, vp.locate("video").attr("aria-label"));
+ jqUnit.assertEquals("aria-label should be set properly", vp.options.strings.videoTitlePreface + expectedLabel, vp.locate("videoContainer").attr("aria-label"));
};
videoPlayerTests.asyncTest("Video label: default", function () {
Please sign in to comment.
Something went wrong with that request. Please try again.