Skip to content

Commit 489818a

Browse files
added an example for createVideo(), with video assets
1 parent a5ec514 commit 489818a

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed
375 KB
Binary file not shown.
428 KB
Binary file not shown.
224 KB
Binary file not shown.

lib/addons/p5.dom.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,8 +946,20 @@
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
*/
950-
p5.prototype.createVideo = function(src, callback) {
962+
p5.prototype.createVideo = function(src, callback) {
951963
p5._validateParameters('createVideo', arguments);
952964
return createMedia(this, 'video', src, callback);
953965
};

0 commit comments

Comments
 (0)