Skip to content

Commit

Permalink
Add posterType:none value
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed Sep 30, 2014
1 parent a586985 commit 976e8b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/jquery.vide.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
findPoster(poster, function (url) {
that.wrapper.css("background-image", "url(" + url + ")");
});
} else {
} else if (this.settings.posterType !== "none") {
this.wrapper.css("background-image", "url(" + poster + "." + this.settings.posterType + ")");
}

Expand Down
2 changes: 1 addition & 1 deletion test/vide.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div id="block1" data-vide-bg="http://vodkabears.github.io/vide/video/ocean" data-vide-options="loop: false, volume:0.3,playbackRate:,position: 60% bottom"></div>
<div id="block2"></div>
<div id="block3" data-vide-bg="mp4: http://vodkabears.github.io/vide/video/ocean, webm: video/ocean.webm, ogv: video/ocean, poster: video/ocean.jpg"></div>
<div id="block3" data-vide-bg="mp4: http://vodkabears.github.io/vide/video/ocean, webm: video/ocean.webm, ogv: video/ocean, poster: video/ocean.jpg" data-vide-options="posterType: none"></div>
<div id="block4" data-vide-bg='{"mp4": "http://vodkabears.github.io/vide/video/ocean", "webm": "video/ocean.webm", "ogv": "video/ocean", "poster": "video/ocean.jpg"}' data-vide-options='{"loop": false, "volume":0.3}'>
<div id="block5"></div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion test/vide_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,17 @@
QUnit.asyncTest("Poster detection", function () {
var inst1 = $block1.data("vide"),
inst2 = $block2.data("vide"),
inst3 = $block3.data("vide"),
wrapper1 = inst1.wrapper,
wrapper2 = inst2.wrapper;
wrapper2 = inst2.wrapper,
wrapper3 = inst3.wrapper;

equal(inst2.settings.posterType, "gif");
ok(wrapper2.css("background-image").search("video/ocean.gif") > -1);

equal(inst3.settings.posterType, "none");
equal(wrapper3.css("background-image"), "none");

equal(inst1.settings.posterType, "detect");
setTimeout(function () {
ok(wrapper1.css("background-image").search("http://vodkabears.github.io/vide/video/ocean.jpg") > -1);
Expand Down

0 comments on commit 976e8b5

Please sign in to comment.