JavaScript - Embedding Quicktime Using Javascript?
i'm newb to java, but need to get my quicktime movie embeds working on windows/explorer. apparently i need to call external java script to make it work: http://developer.apple.com/internet/ieembedprep.html
here is my HEAD code: <script src="kitchslideembed.js" language="JavaScript" type="text/javascript"></script> and BODY code: <script language="JavaScript"type="text/javascript">InsertKitchSlideMovie();</script> and my "kitchslideembed.js" file... function InsertKitchSlideMovie() { document.write('<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="768" height="591" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>\n'); document.write('<param name='src' value="http://jamesgivensdesign.com/public_html/notes/kitchenslide1.mov">\n'); document.write('<param name='autoplay' value="false">\n'); document.write('<param name='controller' value="true">\n'); document.write('<param name='loop' value="false">\n'); document.write('<embed src="kitchenslide1.mov" width="768" height="591" autoplay="false" controller="true" loop="false" pluginspage='http://www.apple.com/quicktime/download/'>\n'); document.write('</embed>\n'); document.write('</object>\n'); } any help out there? Similar TutorialsHello, I am trying to build a jukebox online. I use a quicktime plugin, the reason for this is that windows media player wouldnt work in firefox. I can now work the plugin with javascript to make it stop play pause and fast forward to a song, thing is i cant make it to play another song. in all sources i looked at , this piece of code should be what i am looking for : document.getElementById('movie2').SetQTNEXTUrl(2,'music/myparty.mp3'); well, that in any case wont work for me, then there was another piece of code wich should go in the embed part wich is this: QTNEXT1=myparty.mp3 in firefox it has the effect of opening the myparty.mp3 on another page in wich the quicktime plugin will show but cant find the song, in internet explorer it just simply give's the error "page is ready but with errors". can anyone help me to understand what goes wrong, what would fix it or a simpler way to embed a large amount of songs onto a website? hoping to hear something soon this is the code /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <SCRIPT LANGUAGE = "JavaScript"> function PlayIt(movname) { movname.Play(); } function StopIt(movname) { movname.Stop(); } function rewindIt(movname) { movname.rewind(); } function SetRate(movname,rate) { movname.SetRate(rate); } function SetTime(movname,time) { movname.SetTime(time); } function VolumeIt(movname,v) { movname.SetVolume(v); } document.getElementById('movie2').SetQTNEXTUrl(2,'music/myparty.mp3'); document.getElementByName('movie2').SetQTNEXTUrl(2,'music/myparty.mp3'); document.getElementById('movie2').SetQTNEXTUrl(1,'music/myparty.mp3'); document.getElementByName('movie2').SetQTNEXTUrl(1,'music/myparty.mp3'); </SCRIPT> </head> <body> <embed hidden="false" autostart="true" loop="-1" controls="largeconsole" height="25" width="100"></embed> <body> <br><br> <a href="#" onClick="StartVideo()" ;>startvideo</a><br> <a href="#" onClick="PlayIt(movie2)";>functie</a><br> <a href="javascript:document.movie2.Stop()">Stop</a><br> <a href="javascript:document.movie2.Play()">Play</a><br> <a href="javascript:document.movie2.SetRate(1.0);">SetRate(1.0)</a><br> <a href="javascript:document.movie2.SetRate(2.0);">SetRate(2.0)</a><br> <a href="javascript:document.movie2.SetVolume(100);"> SetVolume(100) </a><br> <a href="javascript:document.movie2.SetVolume(255);"> SetVolume(255) </a><br> <br> <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="180" height="160" id="movie2"> <param name="src" value="music/camaro.mp3"> <param name="Autoplay" value="false"> <embed width="180" height="160" src="music/camaro.mp3" QTNEXT1=myparty.mp3 name="movie2" enablejavascript="true" autostart="false"> </object> <br> <SCRIPT LANGUAGE = "JavaScript"> document.getElementById('movie1').SetQTNEXTUrl(2,'music/myparty.mp3'); document.getElementByName('movie1').SetQTNEXTUrl(2,'music/myparty.mp3'); document.getElementById('movie2').SetQTNEXTUrl(2,'music/myparty.mp3'); document.getElementByName('movie2').SetQTNEXTUrl(2,'music/myparty.mp3'); </SCRIPT> <br> <br> http://userwww.sfsu.edu/~infoarts/te...avascript.html </body> </html> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Hello i'm trying to play just the first few seconds on a quicktime movie then stop. if the user scrolls, I replay - Im doing this to reshow the image that seems to go away when scrolling. By design, once the user clicks 'Play' I want the movie to disregard the scroll (and other) functions. This seems to work in FF, but not in IE, where the movie will not even play initially. I'm getting a 'document.movie1 undefined error'. Any help is much appreciated. Here is the code.... Code: <script src="include/javascript/AC_QuickTime.js" language="javascript" type="text/javascript"> </script> <script type="text/javascript" src="include/javascript/mootools-1.2.5- core-nc.js"></script> <script type="text/javascript" src="include/javascript/Quickie.js"></ script> <!--if IE> <object id="qt_event_source" classid="clsid:CB927D12-4FF7-4a9e- A169-56E4B8A75598" codebase="http://www.apple.com/qtactivex/ qtplugin.cab#version=7,2,1,0" height="376" width="400"> <param name="scale" value="tofit" /> </object> <!endif--> <script type="text/javascript"> function BeginPlayback() { if (document.movie1 !== null) { document.movie1.Play(); document.movie1.SetTime(600); var t = setTimeout("RewindPlayback()", 1000); } } function RewindPlayback() { if (document.movie1 !== null) { document.movie1.Stop(); } } function QTSetup() { var t = setTimeout("BeginPlayback()",1000); } function startUp() { var myQuickie = new Quickie('http://malsup.github.com/video/ simpsons.mov', { id: 'movie1', width: 400, height: 376, container: 'qtmovie', attributes: { controller: 'true', autoplay: 'true', scale: 'tofit' }, onCanplay: function() { }, onLoad: function() { QTSetup(); }, onPlay: function() { if (document.getElementById("hfPlayed").value == "No" && document.getElementById("hfFromScroll").value == "No") { document.getElementById("hfPlayed").value = "Yes"; } }, onPause: function() { document.getElementById("hfFromScroll").value = "No"; } }); } window.onscroll = function() { if (document.getElementById("hfPlayed").value == "No") { document.getElementById("hfFromScroll").value = "Yes"; BeginPlayback(); } }; window.onresize = function() { if (document.getElementById("hfPlayed").value == "No") { document.getElementById("hfFromScroll").value = "Yes"; BeginPlayback(); } }; function onBlur() { if (document.getElementById("hfPlayed").value == "No") { document.getElementById("hfFromScroll").value = "Yes"; BeginPlayback(); } } function onFocus() { if (document.getElementById("hfPlayed").value == "No") { document.getElementById("hfFromScroll").value = "Yes"; BeginPlayback(); } } if (/*@cc_on!@*/false) { // check for Internet Explorer document.onfocusin = onFocus; document.onfocusout = onBlur; } else { window.onfocus = onFocus; window.onblur = onBlur; } </script> <form id="form1" runat="server"> <input id="hfPlayed" type="hidden" value="No" /> <input id="hfFromScroll" type="hidden" value="Yes" /> </form> Hi guys, i would like a script that detects if quicktime is installed like this one here http://developer.apple.com/internet/...lplugins.shtml but i want it to offer the link to quicktime if not installed, and continue to load the player if quicktime is installed. Im thinking something like this.. Code: <script type="text/javascript" src="http://developer.apple.com/internet/webcontent/examples/detectallplugins.shtml "></script> <script> if (detectQuickTime == true) { setTimeout('Redirect()',0); } else { setTimeout('Redirect2()',0); } function Redirect() { location.href = 'http://www.mysite.com/player.htm'; } function Redirect2() { location.href = 'http://www.mysite.com/error-install-quicktime.htm'; } </script> But i cant make it work. Can anyone help? I'm running my web page on IE8+9 with Windows Home via Boot Camp. My JS code is: Code: if (QuicktimeIsPresent) { var song = PlaySong('200', '50', '#9cceff', 'false', 'false', 'tunes/taps.mov') document.write (song) } The JS code for PlaySong is: Code: function PlaySong(width, height, bgcolor, autostart, loop, songloc) { var play = '' if (songloc == '') return play // default values ... if (width == '') width = '200' if (height == '') height = '50' if (bgcolor == '') bgcolor = '#FFFFFF' if (autostart == '') autostart = 'true' if (loop == '') loop = 'false' play = '<OBJECT NAME="Midi"\n' + ' ID="song"\n' + ' CLASSID="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"\n' + ' CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"\n' + ' WIDTH="' + width + '" HEIGHT="' + height + '"\n' + ' LOOP="' + loop + '">\n' + ' <PARAM NAME="bgcolor" VALUE="' + bgcolor + '">\n' + ' <PARAM NAME="autostart" VALUE="' + autostart + '">\n' + ' <PARAM NAME="filename" VALUE="' + songloc + '">\n\n' + '<EMBED NAME="song"\n' + ' PLUGINSPAGE="http://www.apple.com/quicktime/download/"\n' + ' TYPE="audio/x-midi"\n' + ' WIDTH="' + width + '" HEIGHT="' + height + '"\n' + ' LOOP="' + loop + '"\n' + ' BGCOLOR="' + bgcolor + '"\n' + ' AUTOSTART="' + autostart + '"\n' + ' SRC="' + songloc + '">\n' + '</EMBED>\n\n' + '</OBJECT>\n' return play } For IE8+9, the quicktime crescendo/midi control shows .. but when I click the play button on it, it almost immediately stops. Other Windows browsers(Firefox and Safari and IE 7) play just fine, together with all Macintosh browsers. I really need some help here ... thanks in advance. BTW, here's the link. John Love Hi there, does anoyne know how to embed a RSS feed into a webpage? The code I was using before is now no longer supported Thanks Joe Hi - I am using the tinyslideshow and need to be able to embed a wmv file into it. It needs to open within the slideshow as the thumbnail loads and when clicked just as the image does. I have not been able to figure this out or know if it is possible and any help would be greatly appreciated! Thanks so much.
I'm trying to embed flash onto a web page using the flash player that comes with Dreamweaver CS4. I've used other players in the past, such as the Longtail FLV player, but need to use one that's free for commercial use in this case. I've set up the file with a script to load the video dynamically using the swfobject (the CS4 flash player uses a modified version, not sure what's different about it). Everything works as expect on PC, but on Mac for some reason instead of playing the video it just displays the components of the flash player's skin (i.e. play button, etc.). Here's the script: Code: <script src="scripts/swfobject_modified.js" type="text/javascript"></script> <script type="text/javascript"> var flashvars = {}; flashvars.MM_ComponentVersion = '1'; flashvars.skinName = "skins/Halo_Skin_3"; flashvars.streamName = "videos/base"; flashvars.autoPlay = "false"; var params = {}; var attributes = {}; swfobject.embedSWF("FLVPlayer_Progressive.swf", "myContent", "768", "432", "9.0.0","expressInstall.swf", flashvars, params, attributes); </script> And the HTML: Code: <div id="myContent"> <p>Some content requires Adobe Flash Player. You can download it <a href="http://get.adobe.com/flashplayer/" rel="nofollow" target="_blank">here</a></p> </div> Any thoughts on what might be causing the problem? Thanks. I'm getting Error: Object doesn't support property or method 'addEvent' in my webpage. I'm trying to embed a flash carousel in an asp.net page and I have this, but nothing is showing on my page. Using IE9 and FF4 Code: <script type="text/javascript"> window.addEvent('load', function() { var flashvars = { xmlLocation: "<%=ResolveUrl("upload/data.xml")%>", imageLocation: "<%=ResolveUrl("~/upload/")%>" }; swfobject.embedSWF("<%=ResolveUrl("~/upload/Carousel-Test.swf")%>", "FlashContainer", "576", "242", "10.0.32", "", flashvars, null, null); }); </script> The xml has some settings for the images and all my images are in the upload folder in my project. I have reference to the swfobject js in the masterpage (head) and the homepage inherits from it: Code: <script src="javascript/swfobject.js" type="text/javascript"></script>. Anyone give some suggestions? Hello, This question is not really about js per se, but more having to do with w3c specifications. I did not see a more appropriate place to post it. I wish there were such a thing as a w3c forum. I have a large number of QT movies in an archive that I have been displaying using the ol' object/embed tag method. In an attempt to bring the pages up to w3 standards, which does not allow embed tags, I have considered this recommendation from Apple for embedding QT videos: http://developer.apple.com/internet/ieembedprep.html Great, now the pages validate. However, when viewing the generated source written by the js, what do I find? Exactly the same code I used that would not validate - object tags with an embed tag in the container. My question may be somewhat philosophical : Is this just merely a way of "tricking" the w3 validator? I mean, if the effective code that the browser sees is the same, why not just put it in there with HTML in the first place, other than to be able to put the w3 'validates!' icon at the bottom of the page? You see what I am getting at? see below
For a project in my high school web design class, I need to integrate an Excel spreadsheet as data so to speak for a web page. I want to pull the prices from the sheet, and make them appear on the page. I'd like to pull it from the sheet so that the client can still adjust and edit the prices without having to reach the actual webpage. Conceptually, I thought this would be fairly straight forward, but in researching how to do this, I got very confused. I'm not even positive that I'm putting this in the right section. So my main question is this: Is there a way to integrate an Excel spreadsheet in such a way that it can provide data for certain fields of a webpage? If so, can someone please explain how? Thanks, A Confused High School Girl I want to have another go at Javascript. I have several books on the subject but I find that my eyesight is a major problem. Therefore I want to try an on-line solution, preferably free. I have Googled, but there are so many that I am almost dizzy with the choices. Perhaps someone could recommend one. Not too fussy visually. My knowledge is VERY basic. Frank Hello! I am trying to find a script that allows you to open multiple browser tabs and then close each of those tabs, either one by one or all at once. Does anyone know how to do this please? Thanks so much for your help. Does anyone know how to make URL links that use Javascript still work when users have Javascript disabled on their browser? The only reason I'm using JS on a URL is because my link opens a PDF file, and I'm forcing it not to cache so users have the latest version. I tried the <script><noscript> tags, but I'm not sure if I'm using it correctly, as my URL completely disappears. Below is my HTML/Javascript code: <p class="download"> <script type="text/javascript">document.write("<span style=\"text-decoration: underline;\"><a href=\"javascript:void(0);\" onclick=\"window.open( 'http://www.webchild.com.au/mediakit/Direct_Media_Kit_Web.pdf?nocache='+ Math.floor( Math.random()*11 ) );\" >The Child Magazines Media Kit</a></span> (PDF 1 MB) ");</script> <noscript><span style="text-decoration: underline;"><a href="http://www.webchild.com.au/mediakit/Direct_Media_Kit_Web.pdf" >The Child Magazines Media Kit</a></span> (PDF 1 MB)</noscript> </p> Thanks for any help, Michael Hi Guys, I am new at JavaScript and start to do some tutorials.What I am trying to do here is prompting user to input a name and if the name was valid the page(document) will display with all objects like the button.But if user enter a wrong name then the button will be disabled! I create the following code but it did not work <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>New Web Project</title> <script language="JavaScript" type=""> function changeColor(){ document.bgColor = "Gray"; } </script> </head> <body> <script language="JavaScript" type="text/javascript"> var person = ""; person = prompt('What is Your Name:'); if (person == "Foo") { document.write("<h1 />Welcome " + person); document.bgColor = "Yellow"; } else { document.write("<h1 />Access Denied!!!!"); document.bgColor = "Red"; document.getElementById("gree").disabled = true; } </script> <div> <p/><input id="gree" type="button" value="Gray " onClick="changeColor();"> </div> </body> </html> as you can see I used the: document.getElementById("gree").disabled = true; but it did not work , could you please give an idea how I can solve this problem? Thanks Hi, I have the following code snippet: test.html ====== <script language="javascript" type="text/javascript"> var testVariable = "test"; </script> <script language="javascript" type="text/javascript" src="test.js"> </script> test.js ===== var testVariable = window.top.testVariable; In firefox, I'm able to access testvariable defined within test.html in test.js. But in chrome, test.js couldnot get the window.top.testVariable field defined in test.html. Can any one please let me know how i can make it work in chrome?. Am i missing something here?. Hi Guys I am trying to modify the functionality of my page. I want to be able to activate this piece of code using another javascript function. This is the code I want to activate: Code: <script type="text/javascript"><!-- $('#button-cart').bind('click', function() { $.ajax({ url: 'index.php?route=checkout/cart/update', type: 'post', data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea, .date_data input[type=\'text\']'), dataType: 'json', success: function(json) { $('.success, .warning, .attention, information, .error').remove(); if (json['error']) { if (json['error']['warning']) { $('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'); $('.warning').fadeIn('slow'); } for (i in json['error']) { $('#option-' + i).after('<span class="error">' + json['error'][i] + '</span>'); } } if (json['success']) { $('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'); $('.success').fadeIn('slow'); $('#cart_total').html(json['total']); $('html, body').animate({ scrollTop: 0 }, 'slow'); } } }); }); //--></script> And this is how I want the format of the function to be: function testsession() { if there is a session called 'hiredate' { activate the script above } else { var el = document.getElementById("product_data"); } } I just dont know how to write this in javascript Could you help me if possible please I got an index.php Code: <html> <form action="bacakomik.php" method='post'> <select name="kodekomik"> <option value='../komik1/|23'>Judul Komik1</option> <option value="../komik2/|20">Judul Komik2</option> <option value="../komik3/|10">Juduk Komik3</option> <option value="../komik4/|20">Judul Komik4</option> </select> <input type="submit" /> </form> <?php echo ('<select>'); echo ('<option value= "'.$i.'">'.'Page '.$i.'</option>'); echo ('</select>'); ?> </html> As you can see, each of the option brings specific value "../komik1/|23" komik1 is a directory | is a delimiter 23 is the pages in one chapter and can be considered also as how many images are there on a specific directory This is my bacakomik.php Code: <?php $dirkomik = $_POST['kodekomik']; $exploded = explode("|", $dirkomik); echo ($exploded[0]); //picture directory echo ("<br>"); echo ($exploded[1]); //total page in the comic $pagecount = (int)$exploded[1]; //Take last posted value, process it right away echo ('<FORM name="guideform"> '); echo ('<select name="guidelinks">'); $i=1; do { echo ('<option value= "'.$i.'">'.'Page '.$i.'</option>'); $i= $i+1; }while($i <= $pagecount); //Printing option and select echo ("</select>"); ?> <input type="button" name="go" value="Go!" onClick="document.getElementById('im').src=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value+'.png';"> </FORM> <img src="img0.jpg" id="im"> With the current code on bacakomik.php, I only can change the img src of id "im" in the same directory only. What I want is that the Javascript could "add" the "$exploded[0]" variable so that the picture can be loaded from different directory. Anyone can do this? I believe that the fix should be somewhere on input tag inside OnClick, or do you know where? Anyway, I found this on the net http://p2p.wrox.com/php-faqs/11606-q...avascript.html Please help me to those who can... Hey, I've got to make the values of some textboxes change the co-ordinates of my sprite on a canvas and havent a clue on how to do it, Here is my form with the two textboxes and submit button: <form> x: <input type="text" name="x" /><br /> y: <input type="text" name:"y" /><br /> <input type="submit" value="Submit"/><br /> </form> And i need it so that they change the values of these: //this shows where my sprite will start on the canvas var block_x; var block_y; searched the internet for hours and cant really find anything i understand or works. any help is much appreciated |