- Include autofill files after jPlayer:
<script type="text/javascript" src="jplayer.autofill.js"></script>
- Insert HTML tags where you want the video to appear as follows:
<div class="video" data-path="path/to/video.mp4" data-poster="path/to/image.png" data-title="Crazy Movie"></div>
- Call it from JavaScript:
autofill(".video","template.html");
- To use delayed instantiation, include jplayer.autofill.delay.js instead of jplayer.autofill.js
- Now when you call the autofill() function as above, it will only create the HTML structure, but not instantiate the video.
autofill(".video","template.html");
- To instantiate the video, call:
$(".jp-jplayer").trigger("loadVideo");
-
Notifications
You must be signed in to change notification settings - Fork 0
namlet/jPlayer-Autofill
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A simple function to automate the insertion of the needed HTML, maintain uniqueness, and instantiate the videos.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published