Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- load SWFObject current folder -->
- <script src="http://localhost/wordpress1/wp-content/uploads/jw-player-plugin-for-wordpress/player/swfobject.js"></script>
- <script src="http://localhost/wordpress1/wp-content/EasyCaptions.js"></script>
- <script src="http://localhost/wordpress1/wp-content/uploads/jw-player-plugin-for-wordpress/player/jwplayer.js"></script>
- <script>
- /* --- For JW Media Player's caption handling ---
- The following code is specific to JW Media Player.
- You could replace with something else if you
- prefer other Flash video players.
- */
- function playerReady(obj){
- document.getElementById(obj.id).addModelListener("TIME", "jw_timeupdateHandler");
- }
- var jw_timeupdateHandler;
- /* --- END JW Media Player code --- */
- //Use SWFObject's addDomLoadEvent function
- swfobject.addDomLoadEvent(function (){
- var easy = new EasyCaptions({
- videoElementID: "video-html5",
- transcriptElementID: "transcript",
- transcriptEnabledClass: "enabled",
- enableCaptions: false
- });
- if(!easy.html5_supported){
- //Embed SWF
- var flashvars = { file: '<?php echo get_post_meta(get_the_ID(), thinema, true); ?>', controlbar: 'over', autostart: 'false'};
- var parameters = {};
- var attributes = { id: "video-swf", name: "video-swf" };
- var callback = function (){
- //Set up the flash fallback as a callback that occurs AFTER the swf is embedded by SWFObject
- easy.addFallback({
- elementID: "video-swf",
- captionHandler: function (video, updateCaption){
- },
- transcriptHandler: function (video, position){
- //The following code is specific to JW Media Player.
- //You could replace with something else if you
- //prefer other Flash video players.
- //Ensure video is playing before trying to SEEK
- if(video.getConfig().state !== "PLAYING"){
- video.sendEvent("PLAY", "true");
- }
- video.sendEvent('SEEK', position);
- }
- });
- };
- swfobject.embedSWF('http://localhost/wordpress1/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf', 'video-html5', '480', '320', '9.0.0', false, flashvars, parameters, attributes, callback);
- }
- //Set up Flash fallback handler.
- //The following code is specific to JW Media Player.
- //You could replace with something else if you
- //prefer other Flash video players.
- jw_timeupdateHandler = function (video){
- easy.updateCaption(parseInt(video.position, 10));
- };
- /* Progressive enhancement BONUS:
- Add notice to transcript letting people know it's clickable */
- if(easy.transcript_element){
- var target_el = easy.transcript_element.getElementsByTagName("h3")[0].nextSibling;
- var new_el = document.createElement("h4");
- new_el.innerHTML = "Click on the text below to play that point in the video.";
- easy.transcript_element.insertBefore(new_el, target_el);
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement