Skip to content

#1954: added an example for createVideo(), with video assets #2545

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

Merged
merged 2 commits into from
Jan 20, 2018
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
Binary file added docs/yuidoc-p5-theme/assets/small.mp4
Binary file not shown.
Binary file added docs/yuidoc-p5-theme/assets/small.ogv
Binary file not shown.
Binary file added docs/yuidoc-p5-theme/assets/small.webm
Binary file not shown.
12 changes: 12 additions & 0 deletions lib/addons/p5.dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,18 @@
* up to its end without having to stop for
* further buffering of content
* @return {p5.MediaElement|p5.Element} pointer to video p5.Element
* @example
* <div><code>
* var vid;
* function setup() {
* vid = createVideo(['small.mp4', 'small.ogv', 'small.webm'], vidLoad);
* }
*
* // This function is called when the video loads
* function vidLoad() {
* vid.play();
* }
* </code></div>
*/
p5.prototype.createVideo = function(src, callback) {
p5._validateParameters('createVideo', arguments);
Expand Down