Skip to content

Commit 3b862f0

Browse files
authored
Merge pull request #2545 from eJohnstonePhd1991/master
#1954: added an example for createVideo(), with video assets
2 parents a49d03d + 14a9c52 commit 3b862f0

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

docs/yuidoc-p5-theme/assets/small.mp4

375 KB
Binary file not shown.

docs/yuidoc-p5-theme/assets/small.ogv

428 KB
Binary file not shown.
224 KB
Binary file not shown.

lib/addons/p5.dom.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,18 @@
946946
* up to its end without having to stop for
947947
* further buffering of content
948948
* @return {p5.MediaElement|p5.Element} pointer to video p5.Element
949+
* @example
950+
* <div><code>
951+
* var vid;
952+
* function setup() {
953+
* vid = createVideo(['small.mp4', 'small.ogv', 'small.webm'], vidLoad);
954+
* }
955+
*
956+
* // This function is called when the video loads
957+
* function vidLoad() {
958+
* vid.play();
959+
* }
960+
* </code></div>
949961
*/
950962
p5.prototype.createVideo = function(src, callback) {
951963
p5._validateParameters('createVideo', arguments);

0 commit comments

Comments
 (0)