JavaScript - How To Stop A Flash Video With Jquery
is there a way to stop a flash video with jQuery??
I'm using a html5 video with flash fallback.. i'm using the video on a modal pop up.. when i try to hide the video, the flash video doesn't stop... so before i hide the mask, i must stop or pause the video, then hide.. i tried various ways, but i can't seem to make them work.. Code: <video id="480p" width="848" height="480" controls="controls" poster="New_Test_Encodes_7-31-11/Test_Encode_Desktop_7-31-11/poster.jpg"> <source src="New_Test_Encodes_7-31-11/Test_Encode_Desktop_7-31-11/Marie_Mcray_Test-H264_480p.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> <source src="New_Test_Encodes_7-31-11/Test_Encode_Desktop_7-31-11/Marie_Mcray_Test.ogg" type='video/ogg; codecs="theora, vorbis"' /> <!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. --> <object id="480pfallback" class="480p" width="848" height="480" type="application/x-shockwave-flash" data="flowplayer/flowplayer-3.2.7.swf"> <param name="movie" value="flowplayer/flowplayer-3.2.7.swf" /> <param name="allowfullscreen" value="true" /> <param name="flashvars" value='config={"playlist":["New_Test_Encodes_7-31-11/Test_Encode_Desktop_7-31-11/poster.jpg", {"url": "New_Test_Encodes_7-31-11/Test_Encode_Desktop_7-31-11/Marie_Mcray_Test-H264_480p.mp4","autoPlay":false,"autoBuffering":false}]}' /> <!-- Image Fallback. Typically the same as the poster image. --> <img src="New_Test_Encodes_7-31-11/Test_Encode_Desktop_7-31-11/Marie_McCray_A_O_poster.jpg" width="848" height="480" alt="Poster Image" title="No video playback capabilities." /> </object> </video><!--480p--> Similar TutorialsI am using joomla, and have a tabbed menu at the top, which has different articles embedded within. I have embedded a flash video inside each article. The problem is that if i play a video and then switch to the other tab (article) without pausing the video, the video keeps on playing. And if i try to play the video in the other article, then both videos start playing. I want to stop the first video from playing as soon as I switch to the new tab. There are a lot of different files which are included in the page, so If I know where to place a particular code within the source of the final rendered webpage, I will be able to place it at the right point in a particular file. thanks the website link is: http://tinyurl.com/ycg4tcm I want to run a flash video on my web site. I've been working on this for days now, and obviously missing something. The page is really BRIEF -- nothing more than <object> calls and swfobject.registerObject call. when I look at it on the server, I get a totally blank page in IE. In firefox, I see a little "block" tab where the movie frame would be if it worked. Here is the whole code: thanks so much for looking at it. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <LINK REL="SHORTCUT ICON" HREF="http://olympiceq.com/favicon.ico"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Olympic Equine</title> </head> <body> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="360" height="264" id="FLVPlayer"> <param name="movie" value="FLVPlayer_Progressive.swf" /> <param name="quality" value="high" /> <param name="wmode" value="opaque" /> <param name="scale" value="noscale" /> <param name="salign" value="lt" /> <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Corona_Skin_2&streamName=HorseswithClicktoPlay&autoPlay=false&autoRewind=false" /> <param name="swfversion" value="8,0,0,0" /> <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. --> <param name="expressinstall" value="expressInstall.swf" /> <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="FLVPlayer_Progressive.swf" width="360" height="264"> <!--<![endif]--> <param name="quality" value="high" /> <param name="wmode" value="opaque" /> <param name="scale" value="noscale" /> <param name="salign" value="lt" /> <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Corona_Skin_2&streamName=HorseswithClicktoPlay&autoPlay=false&autoRewind=false" /> <param name="swfversion" value="8,0,0,0" /> <param name="expressinstall" value="expressInstall.swf" /> <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --> <div> <h4>Content on this page requires a newer version of Adobe Flash Player.</h4> <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p> </div> <!--[if !IE]>--> </object> <!--<![endif]--> </object> <script type="text/javascript"> <!-- swfobject.registerObject("FLVPlayer"); //--> </script> </body> </html> I have created a transparent flash video (virtual spokesperson) for my website. For demoing purposes, I would like to have this appear on any desired website. This is what I am trying to produce - here a virtual spokesperson appears on the codingforums.com website: http://www.innovateads.com/iads/demo...dingforums.com Have a look at other sites which enable one to type in a URL and their demo virtual spokesperson appears on the given site: http://www.vspworldwide.com, http://www.impactspokesperson.com, http://www.websitetalkingheads.com and http://www.laserstreamvideo.com. I believe they do this within an iframe to display the underlying website. Any ideas how to get this working ? I would really appreciate any feedback, code, how-tos, links... whatever. I am a complete javascript newbie. Thanks hi, I have created a flash video that work on a php table (like php-nuke), this is seen well on my PC, instead with various screen the video size is not good. ON screen big the video is small, on screen small the video is big... How i can made a script that change the dimension of flash video ? any idea ? please help me.. This is what I have so far which works as a cross-browser download however Firefox will play the video locally inside the popup window: is this normal behaviour? Code: <span class="popup"><a href="javascript:void(window.open('videos/directdrive.flv','','height=383,width=512'));">Watch a video!</a></span> link to the page This is a very new area for me as you can probably tell and I was wondering if websites require a flash player to view video or do some browsers have a flash player built in as Firefox has led me to believe? Thanks. Hi from Ireland! I recently signed up to Google Analytics and it began to block my flash content. I removed the tracker code (javascript) and deleted my account though my flash content is still blocked. Can someone help? I'll buy you a pint. I am not sure if I am in the right section. I tried to search this but couldn't find what I needed. I am very limited on my javascript knowledge. I need a video player that functions almost exactly like the one in this example: http://www.popcap.com/games/bookworm...L_1_8_19_08_en {the links that toggle between the video and flash slideshow depending on which is clicked. The player showing the videos and screenshots for the game}. I tried looking at the source to understand the functions, but my code is not working. I know the player is calling some javascript, but I'm not sure I understand it all. Can someone explain to me the basic functioning of this player as shown? I would very much appreciate it. Hello everyone! I found this article over devness: http://devness.com/2009/06/playing-w...animated-menu/ It is fantastic, but I'm a complete n00b and I was wondering what the JavaScript would look like if the situation was a little different. Picture this: A Super Mario sprite with him standing normally, but to his right is the word "Home". Upon roll over of either the sprite itself or the text, mario does one of his trademark jumps by the way of a few sprites. I know how to do this in flash, but I would like to eliminate it so I have maximum compatibility and no external plugins required. Anyone have any ideas or suggestions? Any help is greatly appreciated!! Jquery, Jcarousel problems - want it to go back to the start and then stop Here is the link - I want it to go from the last - which would be the 3rd image and swoosh back to the beginning and stop. my alternative is already uploaded where I have it just go to the 4th which is the same at the first.. Help it would look nicer with it swooshing back to the beginning and stopping. http://www.macrojump.com/sti_demo/home.php Code: $(document).ready( function() { function carouselInit(carousel) { $('.level0-hero-carousel .carousel-control a').bind('click', function() { carousel.scroll( parseInt( $(this).attr('rel') ) ); carousel.stopAuto(); return false; }); carousel.clip.hover(function() { //carousel.stopAuto(); }, function() { //carousel.startAuto(); }); }; function firstItemAction(carousel, item, idx, state) { $('.level0-hero-carousel .carousel-control a').removeClass('active').eq(idx-1).addClass('active'); }; $('.level0-hero-carousel').jcarousel({ scroll: 1, initCallback: carouselInit, itemFirstInCallback: firstItemAction, auto: 4, wrap: 'first', animation: 1500, buttonNextHTML: null, buttonPrevHTML: null }); if( $('.level0-hero-carousel ul li').size() > 1 ) $('.level0-hero-carousel .carousel-control').show(); $('.level0-hero-carousel .carousel-control a').hover(function() { $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); }); /* Alerts */ $('.level0-alerts ul li').eq(0).show(); var alertsInterval = null; var alertsIndex = 0; var alertsIntervalLength = 1500; var alertsCount = $('.level0-alerts ul li').size(); var expandedSizeClass = 'level0-alerts-expanded-' + alertsCount; // Update NumAlerts Text $('.level0-alerts .alerts-toggle span').text( alertsCount + ' Alerts' ); $('.level0-alerts .alerts-controls .alerts-toggle').bind('click', function() { var itemsCount = $('.level0-alerts ul li').size(); if( $('.level0-alerts').hasClass('level0-alerts-expanded') ) { $('.level0-alerts').removeClass('level0-alerts-expanded'); $('.level0-alerts').removeClass(expandedSizeClass); switchAlert(); startAlertsInterval(); } else { $('.level0-alerts').addClass('level0-alerts-expanded'); $('.level0-alerts').addClass(expandedSizeClass); $('.level0-alerts ul li').show(); stopAlertsInterval(); } return false; }); var switchAlert = function() { $('.level0-alerts ul li').hide(); alertsIndex++; $('.level0-alerts ul li').eq(alertsIndex % alertsCount).show(); } var startAlertsInterval = function() { if(alertsInterval == null) alertsInterval = setInterval(switchAlert, alertsIntervalLength); } var stopAlertsInterval = function() { if(alertsInterval != null) { clearInterval(alertsInterval); alertsInterval = null; } } if(alertsCount > 1) { $('.level0-alerts .alerts-controls').show(); startAlertsInterval(); } }); /* * jQuery Placeholder Plug-in * * Copyright (c) 2010 Max Davis * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: 1 * Version: 0.1 * * v0.1 * - First public release * */ (function($){ $.fn.placeholder = function() { $(this).each( function() { if($(this).attr("type") == "password") { var original_pass_field = $(this); if(original_pass_field.val() == "") { $(this).parent().append("<input type=\"text\" value=\""+ $(this).attr("placeholder") +"\" name=\"pass_placeholder\" class=\"form-text placeholder-inactive\" id=\"pass_placeholder\">"); $(this).css("display","none"); } var original_pass_field = $(this); $("#pass_placeholder").focus(function() { if(original_pass_field.val() == "") { $("#pass_placeholder").css("display","none"); original_pass_field.css("display",""); original_pass_field.focus(); } }); original_pass_field.blur(function() { if(original_pass_field.val() == "") { $("#pass_placeholder").css("display",""); original_pass_field.css("display","none"); } }); } else { if($(this).val() === "") { $(this).val($(this).attr("placeholder")); $(this).addClass('placeholder-inactive'); } $(this).focus(function() { if($(this).val() === $(this).attr("placeholder")) { $(this).removeClass('placeholder-inactive').addClass('placeholder-active'); $(this).val(""); } }).blur(function() { if($(this).val() === "") { $(this).removeClass('placeholder-active').addClass('placeholder-inactive'); $(this).val($(this).attr("placeholder")); } }); } } ) } })(jQuery); hi I am trying to play a video from youtube. What I have done so far is getting videos from my database and displaying all those videos thumbnails. So now what i want is to when i click any thumbnail it should play that video in my website. How can I do this? Here is my code Code: function showResult(result) { $('#videosLoader').css('display','none'); var videoId = result.split(" "); for(i = 0; i < videoId.length - 1; i++) { var vidId = $.trim(videoId[i]); vidLink = getScreen(vidId,"small"); $('#videosList').append("<div class='playVid'>" + "<img width=80 height=80 src=" + vidLink + " alt='' /> " + "<input type='hidden' name='vidId' value='" + vidId + "' />" + "</div>").addClass("playVid"); } $('.playVid').click(function() { var val = $("input[name='vidId']").val(); alert("val"); $("#haveYourDefinition").append("<embed src='http://www.youtube.com/v/" + val + "&rel=1' pluginspage='http://adobe.com/go/getflashplayer' type='application/x-shockwave-flash' quality='high' width='450' height='376' bgcolor='#ffffff' loop='false'></embed>"); }); When I click any thumbnail it does nothing. Why and please tell me how to do this? Help Hi, I currently created a video uploader, but when the video is too big in size, the page seems to be not doing any until the video is completely uploaded. I want to put somewhat like "loading.. please wait" script until the video is not completely uploaded. Thanks. //Ana hi guys, i was wondering if anyone could help me. Ive been looking into the above and want to implement it on my site. I have created no flash pages and flash pages, but instead of creating a portal at the front of the site that leads you to a flash site and a no flash site id like to do it so the page detects flash or not, and redirects to whichever URL. Is this possible, or do multiple browsers cause problems ? cheers So, i have this code which retrieves php files for me using jquery and id love to get it working with Jquery history plugin. I tried modifying the code i got from the ajax demo to work for me, but i just couldnt do it as i do not know any javascript really.. ( actually what i tried was simply to change "#ajax-links a" to "#menu li a" and .html to .php ..but nothing.. :rolleyes: Id be very gratefull if someone would help me out with this one. All related code can be found bellow (the ones that should be needed anyways): This is the code that retrieves php files inside "#content" when item from "#menu li a" with the specified id is clicked Code: $(document).ready(function(){ //References var change = $("#menu li a"); var loading = $("#loading"); var content = $("#content"); //Manage click events change.click(function(){ //show the loading bar showLoading(); //load selected section if(this.id == "home") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/index.php", hideLoading); content.slideDown(); } else if(this.id == "secondpage") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/secondpage.php", hideLoading); content.slideDown(); } else { //hide loading bar if there is no selected section hideLoading(); } }); //show loading bar function showLoading(){ loading .css({visibility:"visible"}) .css({opacity:"1"}) .css({display:"block"}) ; } //hide loading bar function hideLoading(){ loading.fadeTo(1000, 0); }; }); Heres the structure of the menu/content Code: <ul id="menu"> <li><a id="home" class="normal" href="#Home"></a></li> <li><a id="secondpage" class="normal" href="#Secondpage"></a></li> </ul> <div id="content"> <ul id="sec-menu"> <li><a id="link1" class="normal" href="#">Link1</a></li> <li><a id="link2" class="normal" href="#">Link2</a></li> </ul> </div> Heres the code that jquery history plugin uses in demo for ajax Code: jQuery(document).ready(function($) { function load(num) { $('#content').load(num +".html"); } $.history.init(function(url) { load(url == "" ? "1" : url); }); $('#ajax-links a').live('click', function(e) { var url = $(this).attr('href'); url = url.replace(/^.*#/, ''); $.history.load(url); return false; }); }); hi, i have a jquery problem... this script is not working with jquery-1.4.2.min, but it works with jquery-1.2.6.min.js, can anyone help me???the script is the above: (it is not working the tab actions, the slideout works...) http://www.benjaminsterling.com/wp-c...es/sidetab.htm the javascript code is the above: PHP Code: var jqsideTabs; var tabs, h = 50, r = 0,ra = 0; $(document) .ready(function(){ jqsideTabs = $('#sideTabs').addClass('closed'); tabs = jqsideTabs .find('.tab h3') .clone() .appendTo(jqsideTabs) .each(function(i){ var that = $(this), cls = '',ow,newThis, newEl; if( i == 0 ) cls = ' active'; newEl = $('<a href="#" class="tabLinks'+cls+'">' + that.text() + '</a>'); that.replaceWith(newEl); ow = newEl.outerWidth(); if( i == 0 ) ra = ow; else r = ow; h = newEl.css({'top':h , 'right': -ow }).height() + h; newThis = newEl.get(0); newThis.jq = newEl; newThis.i = i; newEl.click(function(){ var el = this.jq; if( jqsideTabs.hasClass( 'closed' ) ){ jqsideTabs.removeClass('closed'); } else if( !jqsideTabs.hasClass( 'closed' ) && el.hasClass('active') ){ jqsideTabs.addClass('closed'); } el .siblings() .removeClass('active') .css({'right': -r }) .end() .addClass('active') .css({'right': -ra }); tabs.eq( this.i ).show().siblings('.tab').hide(); return false; }); }) .end() .parent() .eq(0) .addClass('active') .end() .filter(':not(:eq(0))') .hide() .end(); jqsideTabs.bind("mouseleave",function(){ jqsideTabs .animate({left:-310}, 'fast', function(){ jqsideTabs.addClass('closed').removeAttr('style'); }); }); }); and the html file is: [HTML] <div id="sideTabs"> <div class="tab"> <h3>Tab 1</h3> <div class="gut"> <p>Some text</p> </div> </div> <div class="tab"> <h3>Tab 2</h3> <div class="gut"> <ul> <li>link</li> </ul> </div> </div> <div class="tab"> <h3>Tab 3</h3> <div class="gut"> <ul> <li>link</li> </ul> </div> </div> </div> [/HTML] the problem is that the tab button works, but the content doesnt change...in all of tabs showing the same text(showing all tbas content).... can anyone help...please..... i keep getting the error GET http://code.jquery.com/jquery.min.map net::ERR_TOO_MANY_REDIRECTS & Failed to load resource: net::ERR_TOO_MANY_REDIRECTS when i load my page...and the havascript doesn't work properly on ym page...how do i resolve this. thanx in advance var s="attr" var i=$(s) // jQuery(elem).attr(attr,eval("elm"+attr)); jQuery(elem).$(s)(attr,eval("elm"+attr));//i tried this. how to assign a variable name in the above code(in place of s) so that i need to add an attribute to the element "elem". Hi Guys, Quick question, is there a way to stop a JavaScript from validating after a certain point of the code. I've been "googling" like crazy and cant find a solution. I had to add a Checkbox validation last second and there was existing validation and I'm not good enough to alter all of it to reflect the checkbox part so what I did was I checked to see if at least one of the checkboxes was selected, if yes, do nothing and finish the rest of the validation. If no, prompt them with an error. The problem is after it prompts them for an error, it continues to run the rest of the validation and at the end it allows the end user to print. I cannot allow the end user to print until everything is filled in. Here is my code: Code: function validateFields() { var fieldsToVerify = [ ["PrincipalInvestigator"], ["ContactEmailAddress"], ["RFAward"], ["Sponsor"], ["AwardTitle"], ["BudgetStartDate"], ["BudgetEndDate"], ["SectionII"], ["ProjectRole"], ["EmployeeName"], ["DatesofAppointment"], ["EffortonProject"], ["Date"], ["PrintName"], ["Date2"], ["PrintName2"], ]; var emptyFields = []; var notFullFields = []; for (var i=0; i<fieldsToVerify.length; i++) { var f = this.getField(fieldsToVerify[i][0]); if (f==null) { console.println(fieldsToVerify[i][0] + " not found."); continue; } if (f.valueAsString=="") { emptyFields.push(f.name); } else if (fieldsToVerify[i].length>1 && f.valueAsString.length<fieldsToVerify[i][1]) { notFullFields.push([f.name,fieldsToVerify[i][1]]); } } for (var i in nonRequiredFieldsToVerify) { var f = this.getField(nonRequiredFieldsToVerify[i]); if (f==null) { console.println(nonRequiredFieldsToVerify[i] + " not found."); continue; } if (f.valueAsString!="" && f.valueAsString.length<f.charLimit) { notFullFields.push([f.name,f.charLimit]); } } if (this.getField("CheckBox1").value=="Yes" || this.getField("CheckBox2").value=="Yes" || this.getField("CheckBox3").value=="Yes" || this.getField("CheckBox4").value=="Yes" || this.getField("CheckBox5").value=="Yes" || this.getField("CheckBox6").value=="Yes" || this.getField("CheckBox7").value=="Yes") {} else app.alert("Select a Checkbox in Section I before printing") if (emptyFields.length==0 && notFullFields.length==0) { this.print(); } else { var msg = ""; if (emptyFields.length>0) { msg += "The following fields must be filled-in:\n"; for (var i in emptyFields) msg += emptyFields[i]+"\n"; } if (notFullFields.length>0) { if (msg!="") msg+="\n\n"; msg += "The following fields are not filled-in completely:\n"; for (var i in notFullFields) msg += notFullFields[i][0] + " (required length: " + notFullFields[i][1] + ")\n"; } app.alert(msg,""); } } How do I stop the displaymessage function when i ==1 Code: <script type="text/javascript"> var i =0; function one() { document.getElementById('control').innerHTML = 1; i =document.getElementById('control').innerHTML; } function zero() { document.getElementById('control').innerHTML = 0; i =document.getElementById('control').innerHTML; } function displaymessage() //if (i==0)//this causes problems { alert("Hello World!"); } </script> <body onclick="javascript: displaymessage();"> <div id='control' onmouseover="javascript: one();" onmouseout="javascript: zero()">0</div> Help! I'm not very good with html/css or any web stuff, my friend wants a blogger for his videos that I'm currently working on. Ive managed to create a splash page that features one video and an enter button. The only problem I am having is, one you click on 'wood + wires' it should go into the blog part of the page, which it does, but the sound of the video keeps playing. Is there any way to make it stop? This is the blog http://brennygee.blogspot.com and this is the code I'm using for the splash page... Please help! <!-- Welcome page Start by http://bloggersentral.blogspot.com/ --> <!-- HTML part --> <div style="padding-top:0px;"> <a id="EPEntryButton" onclick="document.getElementById("HTML88").style.display="none";document.getElem entById("Text88").style.display="none""><iframe src="http://player.vimeo.com/video/14285815?byline=0&portrait=0&color=ffffff" width="649" height="365" frameborder="0"></iframe></a> <a id="EPEntryButton" onclick="document.getElementById("HTML88").style.display="none";document.getElem entById("Text88").style.display="none""><img src="http://i640.photobucket.com/albums/uu121/brennygee/WWENTER3.gif" /></a> </div> <!-- CSS part --> <style> #welcome-wrapper{width:650px;margin:0 auto;height:0px;text-align:center;} /* welcome message widget */ #Text88, #EPEntryButton, #EPGrab {position:relative;z-index:100;top:-55px;} #Text88 {background-color:#fff;border:solid 0px orange;color:#222;display:none;padding:15px;} #HTML88 {z-index:350;display:none;} /* DarkLayer div */ #EPDarkLayer {background-color:#000;opacity:100%;filter:alpha(opacity=100);top:0px;left:0px;z-index:500;position:fixed;} /* Entry button */ #EPEntryButton {background-color:none;border:outset 3px none;color:#333;cursor:pointer;font: arial;font-size:25px;padding:10px;text-decoration:none;} #EPGrab {color:white;padding-top:10px;} </style> <!--[if IE 6]> <style> #EPDarkLayer {position:absolute;} </style> <![endif]--> <!-- Javascript part --> <script type="text/javascript"> YourBlogUrl="http://brennygee.blogspot.com/"; //enter your blog url here fromInternal=document.referrer.search(YourBlogUrl); //check come from where getDarkLayer=document.getElementById("EPDarkLayer").style; getText88=document.getElementById("Text88").style; getHTML88=document.getElementById("HTML88").style; if (fromInternal == -1) { //if visitor comes from external page getDarkLayer.width=screen.availWidth+"px"; //set DarkLayer width getDarkLayer.height=screen.availHeight*2+"px"; //set DarkLayer height getHTML88.display="block"; //show DarkLayer getText88.display="block"; //show message } else { //if visitor comes from internal page getHTML88.display="none"; //hide HTML gadget getText88.display="none"; //hide message } </script> <!-- Welcome page End --> |