Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default YouTube aspect ratio to hd instead #5

Merged
merged 1 commit into from
Mar 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/widgets/youtube/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
// Options:
//
// ```
// aspect desired aspect ratio [sd], hd
// aspect desired aspect ratio [hd], sd
// ```
//
// Examples:
//
// ```
// Include video with id 1234 at 16x9 with autoplay
// [[youtube/1234?aspect=16x9&autoplay=1]]
// Include video with id 1234 in standard def with autoplay
// [[youtube/1234?aspect=sd&autoplay=1]]
// ```
//
function render(id, options) {
Expand All @@ -26,5 +26,5 @@ function render(id, options) {
}

module.exports = function(widgets) {
widgets.add("youtube/:id", render, {aspect: "sd"});
widgets.add("youtube/:id", render, {aspect: "hd"});
};
2 changes: 1 addition & 1 deletion test/widgets/youtube/youtube.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="widget-container" data-aspect-ratio="sd">
<div class="widget-container" data-aspect-ratio="hd">
<div class="widget-content">
<iframe src="//www.youtube.com/embed/123" frameborder="0" width="100%" height="100%"
webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
Expand Down
4 changes: 2 additions & 2 deletions test/widgets/youtube/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ describe("Youtube", function() {

describe("aspect", function() {
it("default [sd]", function() {
expect(render("youtube/123")).to.contain('data-aspect-ratio="sd"');
expect(render("youtube/123")).to.contain('data-aspect-ratio="hd"');
});

it("custom", function() {
expect(render("youtube/123?aspect=hd")).to.contain('data-aspect-ratio="hd"');
expect(render("youtube/123?aspect=other")).to.contain('data-aspect-ratio="other"');
});
});
});
Expand Down