Last active
December 29, 2015 17:29
-
-
Save datt/7704443 to your computer and use it in GitHub Desktop.
Initialize jwplayer for showing video on a element.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function displayVideo(elementID, options) { | |
| var defaults; | |
| defaults = { | |
| height: 347, | |
| width: 624, | |
| swfPath: '/jwplayer/jwplayer.flash.swf', | |
| controls: false, | |
| autostart: true | |
| }; | |
| var settings = $.extend({}, defaults, options); | |
| if ($("#" + elementID).length > 0) { | |
| jwplayer(elementID).setup({ | |
| flashplayer: settings['swfPath'], | |
| controls: settings['controls'], | |
| file: settings['url'], | |
| height: settings['height'], | |
| width: settings['width'], | |
| autostart: settings['autostart'] | |
| }); | |
| return true; | |
| } else { | |
| alert("No html element found for initializing video."); | |
| return false; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment