JavaScript - Pulling .mp3 Url For Longtail Media Player
Hello,
I hope this is in the right section. I am relatively new to coding and was hoping someone could point me in the right direction because at the time, I don't even know what to start researching in order to figure out how to do this. If you go to www.livingelectro.com, you will see they use the longtail media player(http://www.longtailvideo.com/players/jw-flv-player/) and pull the song to preview from a Zippyshare page. This is the code they use... (notice they do not pull a .mp3 file like I was doing from this code) Quote: <embed height="20" border="0" width="207" style="margin-bottom: 6px;" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="mp3player" quality="high" menu="false" src="http://www.livingelectro.com/mediaplayer.swf?backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xFFFFFF&file=http://www19.zippyshare.com/downloadMusic%3Fkey%3D815431413%26time%3D1249478236&type=flv" allowscriptaccess="never"/> If you look at MY website, (http://www.edmaddicts.net/index.php?...ews&Itemid=107) you will be able to scroll down and see the song preview bars. Originally, I was inserting the Zippyshare file ending in .mp3 and pulling the song up with either of these codes... Quote: <script src="swfobject.js"></script> <div id="player">This text will be replaced</div> <script type="text/javascript"> var so = new SWFObject('player-licensed.swf','mpl','470','20','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('flashvars','&file=(Zippysharefile.mp3)&backcolor=FFFFFF&lightcolor=660066&screencolor=6 60066&dock=false'); so.write('player'); </script> and also a flash embed code like... Quote: <embed src="player-licensed.swf"width="470"height="20"bgcolor="undefined"allowscriptaccess="always"allowfullscreen="tru e"flashvars="file=(zippysharefile.mp3)&backcolor=FFFFFF&frontcolor=000000&lightcolor=660066&screenco lor=660066&dock=false"/> The Zippyshare file .mp3 is a link stored and pulled up with {FIELDVALUE} in the database. How are they pulling the .mp3 file from Zippyshare so it works everytime? When I insert the .mp3 extension, it only works on my computer and until I reset my cookies. I can NOT host the files on my own website. I am looking forward to learning something. Will Similar Tutorialscan somebody plz give all the parameters that i can use for a media player? I wanna know how to control them with javascript, such as take off the seek, or redirect them after the media player finishes, or do call function after an event happens such as clicking on the play button... i need all the reference for that, i can't on the internet, and even if i did they aren't working. Thank you guys! Hi, can anybody help - I've got an img on a web page that you click to play an mp3 - how can I get the media player to open behind the page [without reloading the page] so that you can carry on looking at the page instead of first minimizing the media player. I've tried a few scripts for pop-ups but they don't work & they prevent the roll-overs from working. Here's the piece of code: <td style="text-align:left; vertical-align:top"> <a href="getoutandgetunderthemoon_HalKemp.mp3"> <SPAN onMouseOver=document.pic1.src="musicbutton3.jpg" onMouseOut=document.pic1.src="musicbutton3.jpg" onLoad=document.pic1.src="whiteblock.jpg"> <img src="whiteblock.jpg" border="o" alt="GET OUT AND GET UNDER THE MOON" style="width:80px; height:80px; border-style:none" name="pic1"></span></a></td> Hi all, I'm currently working on a page that is presented to users which will check browser version, OS version etc. I've managed to do all of these checks with JavaScript but I'm struggling to find out how (or even IF) I can get what version of Windows Media Player the user has installed. We're looking to see if they have WMP11 or greater. The searching I've done has thrown up a couple of things (like a check to see if the version is 5.2 or 6.4 or higher by looking at mimeTypes). Basically can anyone confirm if this is actually possible and if so any pointers would be appreciated. Thanks in advance Hi all, I need Media player to stream and play video in javascript...any help or working link will work. My requirement is I have .wmv files but when i embed them in html pages first it gets downloaded and then it gets played. I need them playing while they are getting downloaded. please help, i have tried lots of codes but got no success Hi, I'm doing embedding Windows Media Player with the HTML but I can not run the script through a different page. The following script that I made: file : player.html Code: <html> <OBJECT id="VIDEO" width="640" height="480" style="position:relatif; left:0;top:0;" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <PARAM NAME="URL" VALUE="file_name.mpg"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="true"> <PARAM NAME="AutoStart" VALUE="true"> <PARAM name="uiMode" value="Full"> <PARAM name="fullScreen" value="false"> <PARAM name="balance" value="0"> <PARAM name="volume" value="100"> <PARAM name="stretchToFit" value="true"> <PARAM name="PlayCount" value="1"> </OBJECT> <br><br> <input type=submit name=play1 value="New File" onClick=document.getElementById('VIDEO').URL="new_file.mpg";> <input type=submit name=play2 value=Play onClick=document.getElementById('VIDEO').controls.play();> <input type=submit name=play3 value=Pause onClick=document.getElementById('VIDEO').controls.Pause();> </html> above is the script for embbeding and scripts to perform the control in Windows Media Player, the script above work well on IE not on Mozzila Firefox (why??), then I save the file with the name player.html The next script I tried to separate the Windows Media Player control into a different file, for example control.html file : control.html Code: <html> <input type=submit name=play1 value="New File" onClick=document.getElementById('VIDEO').URL="new_file.mpg";> <input type=submit name=play2 value=Play onClick=document.getElementById('VIDEO').controls.play();> <input type=submit name=play3 value=Pause onClick=document.getElementById('VIDEO').controls.Pause();> </html> but I can not control the files player.html, my question how do the control on different files (control.html to player.html )...??? for the help I thank you .... Hello, everyone. I'm not much of a programmer, but I have been tasked with something that's stumping not only me, but my whole dev team as well. We need to find a way to pull a user's NT ID (Windows log on), and store it in a variable for use later on, and also to watermark the screen on HTML pages in an eLearning course. I have no idea how to do this and I can't seem to find anyone who has encountered a need for this. Any suggestions?
I tried to rework a short script to pull info from an iframe instead of the basic page it's sitting on, and I got confused. It's not working. Here's what I've got: Code: <script type="text/javascript" language="JavaScript"> function find_div_class() { var divCollection = document.getElementById('iframeId'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; for (var i=0; i<divCollection.length; i++) { if(innerDoc[i].getAttribute("class") == "list-journal-entry-wrapper") { findMeText = divCollection[i].innerHTML; alert(findMeText); } } } </script> Press the button to find the divs with class "iframeId".<br /> <input type="button" onfocus="this.blur()" value="iframeId" onclick="javascript:find_div_class();return false;""/> I tried another way too, but still nothing: Code: <script type="text/javascript" language="JavaScript"> function find_div_class() { var divCollection = document.getElementById('iframeId'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; var info = document.getElementById("list-journal-entry-wrapper"); alert(list-journal-entry-wrapper); } } } </script> I am creating a template generator page that generates a webpage based on what I fill in for certain elements like image name, img src, book title, book author, etc. and these values are sent to me in an excel document which right now I just open and copy and paste everything from the excel document into the form fields for each section. So for example the client sends over a list of book titles they want featured on the page this week and they include author name, author link, book name, book url, img src, etc. and I just copy those new fields into my template and then click generate and the updated HTML code is there for me to copy. This part works totally fine but in the interest of saving time copying upwards of 100 fields from an Excel file into my template, is there a way I can select the excel file (stored locally) on my page with a "browse" directory form and then have a button that runs SQL queries on my Excel document to pull these updated titles, images, etc into my form fields dynamically? Do I need to utilize server technology for this or is there a simple script that when I click a button, will look at whatever excel file I have selected and say "grab this row at this column"? What is the best way to do this? Help! I'm relatively a noob when it comes to this stuff but I do know javavscript and SQL pretty well. I just can't figure out how to access my excel file to pull in the updated information. The excel file's row and column structure never changes, just the content on each row and column. Let me know if you can help. Thanks!!!! Hi.. I should warn, i know almost nothing about javascript. . i've been trying read sample scripts and examples on how to modify this script; but I just don't know enough. I have a script that pulls data from an array, and copies it directly to the clipboard when a user clicks on it. The problem is this only works in IE, because Firefox doesn't by default allow that to happen. I'm trying to change it so that when it is clicked, instead, it takes what was going to be copied to the clipboard, and puts it in a Prompt box for the user to copy and paste. I had other scripts that do that, but I can't for the life of me figure out how to learn from it! This is the function in the current script Code: <script language="javascript" type="text/javascript"> <!-- function selectThis(src) { document.selection.clear; txt = eval(src +".innerText"); theObj = document.all(txt); txtRange = document.body.createTextRange(); txtRange.moveToElementText(eval(src)); txtRange.select(); txtRange.execCommand("RemoveFormat"); txtRange.execCommand("Copy"); alert(txt + " '.$caption[ 'paste' ].'"); } --> </script> '; } and this is the onclick code Code: '; foreach ( $ausgabe as $key => $data) { if ( $key == '' ) continue; if ( ( $_GET[ 'group' ] != '*' ) && ( $this->info[ $key ][ 'xx_data' ] != $_GET[ 'group' ] ) ) continue; $tpack = $this->info[ $key ][ 'pack' ]; $tname = $this->info[ $key ][ 'xx_desc' ]; $jsid= $nick2.'_'.$tpack; if ( isset( $this->info[ $key ][ 'xx_lock' ] ) ) { if ( $this->hide_locked > 0 ) continue; $tname .= ' (gesperrt)'; } $tname = htmlspecialchars( $tname); if ( $javascript > 0 ) { $tname = '<span class="selectable" onclick="javascript:selectThis(\''. $jsid.'\');">'. $tname."</span>\n". '<span id="'.$jsid.'" class="hidden">'. '/msg '.$this->nick.' xdcc send '.$tpack."</span>\n"; } if ( isset( $this->info[ $key ][ 'xx_note' ] ) ) $tname .= '<br>'.$this->info[ $key ][ 'xx_note' ]; $label = "Download mit:\n/msg ".$this->nick.' xdcc send '.$tpack."\n"; if ( isset( $this->info[ $key ][ 'xx_md5' ] ) ) $label .= " \nmd5: ".$this->info[ $key ][ 'xx_md5' ]; if ( isset( $this->info[ $key ][ 'xx_crc' ] ) ) $label .= " \ncrc32: ".$this->info[ $key ][ 'xx_crc' ]; echo ' <tr> <td class="right">#'.$tpack.'</td> <td class="right">'.$this->info[ $key ][ 'xx_gets' ].'</td> <td class="right">'.makesize($this->info[ $key ][ 'size' ]).'</td> <td class="content" title="'.$label.'">'.$tname.'</td> </tr> '; I've spent days at trying to customize it.. but.. i'm not a programmer I was able to get it to open a prompt box, and had it populate with ("copy this code", $variable), but cannot figure out how to have it display the proper values that was clicked on. I have no idea though what is considered efficient either in the code. I hope this isn't considered asking for TOO much help.... Anyone know if there is a way to get the title string from an iframe src coming from another domain?
I'm doing some kind of MP3 Player search in javascript form using the URL from http://beemp3.com/index.php?p= then after the = any user will type the song they want to search and it'll appear as a valid URL search data under beemp3.com. The page is in http://stereowired.wehostyour.info/searchid.html. My problem is getting the value in .superform whenever the onChange occurs. this.value() doesn't work. I need some kind of alternative thanks oh yeah and the whole code Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>MP3 Search Engine</title> <style type="text/css"> *{font-family:"georgia","times new roman"} body{padding:0;margin:0;background:#fff;color:#000;} .center{text-align:center;width:64%;margin:0 auto;} .formatt{width:100%;height:36px;display:block;} .superform{float:left;width:73%;padding:5px 0;border:2px inset #a0a0a0;background:#e8e8e8;font-size:17px;color:#555;text-align:center;display:block;margin-top:1px;text-shadow:1px 1px 0 #fff;} .superform:hover{background:#d8d8d8} .supersubmit{float:right;width:25%;padding:5px 0;border:2px outset #333;background:#434343;font-size:17px;color:#999;display:block;margin-left:1%;text-shadow:1px 1px 0 #121212;} .supersubmit:focus{border-style:inset;color:#fff} #jam{width:100%;display:block;clear;both;border:0;height:600px;} </style> </head> <body> <div class="center"><h2>Stereo wired Search Engine</h2><div class="formatt"> <input class="superform" type="name" onChange="document.getElementById('jam').src="http://beemp3.com/index.php?q="+this.value()+"" /><input class="supersubmit" type="submit" value="Search" /></div> <iframe id="jam" src="http://beemp3.com"></iframe></div> </body></html> Hey all! My supervisor is tasking me with having a webpage resize the windows media player dynamically based on the users resolution. I have tried everything I can think of to make this happen but no luck. Is this even possible? I'm using the following code to embed the video: Code: <object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,1112" type="application/x-oleobject" width="800" height="600" align="left" standby="Loading Microsoft Windows Media Player components..." id="mediaPlayer"> <param name="AutoStart" value="1" /> <param name="FileName" value="../../../videos/Welcome_1.wmv" /> <param name="ShowDisplay" value="False" /> <param name="ShowControls" value="True" /> <param name="ShowStatusBar" value="False" /> <param name="Loop" value="False" /> <embed src="../../../videos/Welcome_1.wmv" width="800" height="600" autostart="1" align="left" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaPlayer"> </embed> </object> I've tried creating variables and substituting those for the width and height of the object code e.g., Code: <script type="text/javascript">var _width=screen.width; var _height=screen.height;</script> followed by Code: <object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,1112" type="application/x-oleobject" width=_width height=_height align="left" standby="Loading Microsoft Windows Media Player components..." id="mediaPlayer"> <param name="AutoStart" value="1" /> <param name="FileName" value="../../../videos/Welcome_1.wmv" /> <param name="ShowDisplay" value="False" /> <param name="ShowControls" value="True" /> <param name="ShowStatusBar" value="False" /> <param name="Loop" value="False" /> <embed src="../../../videos/Welcome_1.wmv" width=_width height=_height autostart="1" align="left" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaPlayer"> </embed> </object> but of course, this doesn't work. Is it even possible?? If so, your help is greatly appreciated. Thank you, M. Hi, Is there any possibility of having the JW player playlist at the bottom. If possible can anyone post the javascript and its attribute for that. Thanks, Ananth I have been searching for an answer to this pretty much all day... I'm fed up. Can someone help? I want to be able to open wmv videos in an embedded windows movie player using javascript. Something identical to what you will find he http://www.hunlock.com/blogs/Everyth...ding#quickIDX2...go down to the heading :'How to make a video select list'. I am trying to emulate this but for wmv files and windows media player rather than for flsh files. I have tested this on one link and it does not open. i just get a black media screen and nothing. Here's my code: Here's the script within the head tag: Code: <script type="text/javascript">function playVideo(sourceId, targetId) { if (typeof(sourceId)=='string') {sourceId=document.getElementById(sourceId);} if (typeof(targetId)=='string') {targetId=document.getElementById(targetId);} targetId.innerHTML=sourceId.innerHTML; return false;}</script> Here`s the link: Code: <a href="#" onclick='return playVideo("selectdemo1","videoPlayback")'> video 1</a> and here's the embedding and the play back code (The play back area is within the same page as the link): Code: div id="selectdemo1"> <OBJECT id='mediaPlayer' width="450" height="445" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <param name='fileName' value="\\HOC\AdminPrivate\FS08U\TurgeL\Documents\Site Web\videos\Add_Documents.wmv"> <param name='animationatStart' value='true'> <param name='transparentatStart' value='true'> <param name='autoStart' value="false"> <param name='showControls' value="true"> <param name='loop' value="false"> <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols="true" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="450" height="445" src="http://servername/\\\\HOC\\AdminPrivate\\FS08U\\TurgeL\\Documents\\Site Web\\videos\\Add_Documents.wmv&autoplay=1" autostart="false" designtimesp='5311' loop="false"> </EMBED> </OBJECT> </div> </div> Please help meeeeeeeeeeeeeeeeeeee! I'm using Fiddler (web debugging tool) and the below code is JScript .NET, which is basically a .NET version of Javascript. Code: if (oSession.HostnameIs("www.youtube.com") && oSession.oResponse.headers.ExistsAndContains("Content-Type","text/html")) // oSession is a Fiddler object session { oSession.utilDecodeResponse(); // Remove any compression or chunking oSession.utilReplaceInResponse('<b>','<u>'); // Search and replace in HTML } How do I replace youtube video player with this message? Code: <div id="player-unavailable" class=" player-width player-height player-unavailable "> <div class="icon meh"></div> <div class="content"> <h1 id="unavailable-message" class="message"> This video is no longer available because of inappropriate content. </h1> <div id="unavailable-submessage" class="submessage"> Sorry about that. </div> </div> </div> Thank you I hope someone can help me...I need to tweak this code so that background music will play randomly for an unlimited time. Right now, it plays a random song and then repeats it over and over. I just need to have it randomly change songs and keep playing! Here is the code I am using... Code: <script type="text/javascript"> var musicSource = [ "http://www.bigmacktrucks.com/music/1.mp3", "http://www.bigmacktrucks.com/music/2.mp3", "http://www.bigmacktrucks.com/music/3.mp3", "http://www.bigmacktrucks.com/music/4.mp3", "http://www.bigmacktrucks.com/music/5.mp3", "http://www.bigmacktrucks.com/music/6.mp3", "http://www.bigmacktrucks.com/music/7.mp3", "http://www.bigmacktrucks.com/music/8.mp3" ]; var rand = Math.floor(Math.random()*musicSource.length); document.write('<embed src="'+musicSource[rand]+'" autoplay="true" hidden="true" loop="true" />'); // --> </script> I think this is simple but I am a total noob at javascript! Thanks in advance! Hi, I am trying to run multiple videos in the JW player by clicking on different links.Its working fine in chrome and firefox, But it doesn't play viseos in IE. Kindly suggest me ...Thanks in advance..Here is the code. <script type="text/javascript"> function start(){ return playVideo("mediaspace","mediawindow"); } function playVideo(sourceId, targetId) { if (typeof(sourceId)=='string') {sourceId=document.getElementById(sourceId);} if (typeof(targetId)=='string') {targetId=document.getElementById(targetId);} targetId.innerHTML=sourceId.innerHTML; return false;} </script> <body onload="start()"> <div id="mediawindow"></div> <div id="mediaspace" class="fltrt" style="display:none"> <script type='text/javascript' > var so = new SWFObject('player.swf','mpl','360','295','9'); so.addParam('allowfullscreen','true'); so.addParam('allowscriptaccess','always'); so.addParam('wmode','opaque'); so.addVariable('playlistfile','IIA2010.xml'); so.addVariable('stretching','fill'); so.addVariable('autostart','true'); so.addVariable('repeat','list'); so.addVariable('skin','stormtrooper.zip'); so.write('mediaspace');</script></div> <p><a href="#" onclick='return playVideo("mediaspace","mediawindow")'>Play all</a><br /> <a href="#" onclick='return playVideo("welcome","mediawindow")'>MC Linda Clark welcomes guests</a><br /></p> You can also have a look on the webpage. Its working well in FF and chrome. you can test it there. http://www.internetindustryawards.co.nz/2010.html Its really urgent... I have a tiny flash player(with controls) in a table on it's own html page. It only plays one piece of music. But I need an unusual popup script which I can't seem to find. I want the tiny player (75 x 30) to popup on it's own without all the window (chrome?) surrounding it. I want it to be in either the top or bottom left corner. I would also like it to popup on load but turn off when I go to a particular page that I have a sound video on and then turn off completely when they leave the domain. It is a music site. Can some one please write a script like this for me and how do I get around annoying popup blockers. Hi, I'm trying to make a dice game, as well as making it two player. I need to be able to have a scoreboard displayed (eg. player 1 has won 7 times and player 2 has won 4) and I need to be able to prompt the user on if they want to play the game again. So far I have the following: Code: <html> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Dice Game --> <!-- player 1 var die = 6; var dice = 2; var player1 = 0; var player2 = 0; function dice_roll(die, dice) { var roll = 0; for (loop=0; loop < dice; loop++) { roll = roll + Math.round(Math.random() * die) % die + 1; } document.form.text.value = roll; } player1 = roll; // End --> <!-- player 2 function dice_roll2(die, dice) { var roll = 0; for (loop=0; loop < dice; loop++) { roll = roll + Math.round(Math.random() * die) % die + 1; } document.form.text.value = roll; } player2 = roll; // End --> if player_1 = player_2 alert("DRAW!") else if player_1 > player_2 alert("Player 1 is the winner!") else if player_1 < player_2 alert("Player 2 is the winner!") </script> <body> <form name=form> <table border=2 cellpadding=5> <tr> <td colspan=2 align=middle>No. of sides/dice</td> </tr> <tr> <td valign=top align=middle> <p><input type=radio checked name=sides onClick="die = 6">6 Sided </td> <td valign=top align=middle> <p><input name=number type=radio onClick="dice = 2" checked> 2 </td> </tr> <tr> <td align=middle colspan=4> <input type=button value="Roll Dice" name=button onClick="dice_roll(die, dice)"> <input type=text size=10 name=text> </td> </tr> </table> </form> </center> </body> </html ^^ I basically just tried duplicating the original function that adds up the 'dice'. But it doesn't work, I've tried playing around with if/else statements etc to get it to display messages and so fourth, but I have failed. Any help would be appreciated. I only started javascript last week and my teacher isn't really helping explain lots of it. Thanks in advance. |