PHP - Media Player And Php Variables
Hi
I'm building a site that contains access to some mp3 files of people speaking English. I would like a media player that is able to handle a variable that results from a database search. I can use <a href etc> to link to the relevant file but would like to use a server-side player to stream the file, rather than the client's browser. Something like Dewplayer would be perfect but it seems only to take a static file (maybe I'm wrong there). The player appears within <object> tags, like this <code> echo '<object type="application/x-shockwave-flash" data="/player/dewplayer.swf" width="200" height="30" id="dewplayer" name="dewplayer">'; echo '<param name="movie" value="/player/dewplayer.swf" />'; echo '<param name="flashvars" value="mp3=file.mp3" />'; echo '<param name="wmode" value="transparent" />'; echo '</object>'; </code> (the code is freely downloadable so hope I'm not breaking any rules posting someone else's code here). Is there a way I can specify a variable in value? If not, does anyone know of a player that I can use that does allow that? Grateful for any help. Thanks in advance. Similar Tutorialsthe below works in firefox but doesn't work in internet explorer is there something wrong with it <?php $file = $_GET["Watch"]; echo "<OBJECT ID='MediaPlayer' WIDTH='450' HEIGHT='310' CLASSID='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6' STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject'> <PARAM NAME=".$file." VALUE='../audio/audio_files/".$file.".wmv'> <PARAM NAME='autostart' VALUE='false'> <PARAM NAME='ShowControls' VALUE='true'> <PARAM NAME='ShowStatusBar' VALUE='true'> <PARAM NAME='ShowDisplay' VALUE='false'> <EMBED TYPE='application/x-mplayer2' SRC='../dvds/dvd_files/".$file.".wmv' NAME=".$file." WIDTH='450' HEIGHT='310' ShowControls='1' ShowStatusBar='1' ShowDisplay='0' autostart='0'></EMBED> </OBJECT>"; ?> Hi guys. My situation is the following... I want to be able to play videos on a website using a media player. I currently have the pathnames of the videos stored in a mysql database and the videos stored on my file system. I intend to use some PHP script in order to locate the video pathname in the database and then pass it to the media player where it will play the file. I was wondering how i go about this? as i am fairly new to PHP. The media player i am using can be found at: http://rainbow.arch.scriptmania.com/scripts/music/video.html Any help would be much appreciated I want to place Custom background image for embedded media player Can anyone help me? well.. i have vbulletin 4 forum i try to put video player so if i upload mp4 file so i can play video but sad part is its working only at firefox browser can you help me out .. video code looks like this
<vb:if condition="$attachment[attachmentextension] == mp4"> pls i really want that put to work in every browser sadly it works only in firefox somehow.. I want to create a media library in the CMS, similar to how it is in WordPress but custom-coded in PHP on my own site. Can this be done simply with a database connection or will the images need to be uploaded to a server? Bit confused as to how it works and which is the best way to go about it. Thanks for any help. Edited January 12 by Richie1209Hi all
I am using media queries in my css to create a responsive site, when I view the site on a mobile, the site responds as I intend it to.
However if I view it on a desktop and resize the screen, it doesn't respond as I would like, the idea is, if I resize the desktop version enough then I will view the mobile version.
in one css file I have
@media screen and(max-width: 1024px) { css styles }and then on another file, I have the following, the idea with this is when I get below the specified screen size the items don't show @media screen and (min-width: 1024px) { }if you need any more info let me know. Thanks Mark I have Wordpress based site where i've included a class for the main menu that produces a hover and shadow effect. Problem is it breaks the menu in the fully responsive mode when the display adjusts for the viewing dimensions. So I need to remove that class from the menu for anything related to the @media controls.
The site is viewable he http://ailimconsulting.com
If you view it full screen then you'll see the hover effect. Shrink it down and you'll see the menu collapses (it's designed to) but when you use the menu the shadow/hover effect is still present and 'breaks' the menu (loooks like jumbled crap). We just want to remove the hover effect for viewing on mobile devices.
I'm not sure if there's a CSS way to 'remove' a class. This may have to be done with jQuery. I'm looking for options and if anyone knows how I would either remove or counteract the float-shadow class.
Thanks.
Hi, I need to unlink my images in my Media Library (wordpress) on my blog: http://www.jbiddulph.com/blog/index.php/featured/ Please help?! I think it is in this piece of code: foreach ( $attachments as $id => $attachment ) { $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); $output .= "$link"; if ( $captiontag && trim($attachment->post_excerpt) ) { $output .= " " . wptexturize($attachment->post_excerpt) . " "; } if ( $columns > 0 && ++$i % $columns == 0 ) $output .= ''; } does anyone know how to decode this XML variable value into string values? I also need to know the oposite way: creating variable values into xml. I've tried several code examples but they did filter the requested data. Code: [Select] $xml='<?xml version="1.0" encoding="utf-8"?> <elements> <text identifier="ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02"> <value/> </text> <textarea identifier="a77f06fc-1561-453c-a429-8dd05cdc29f5"> <value><![CDATA[<p style="text-align: justify;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></value> </textarea> <textarea identifier="1a85a7a6-2aba-4480-925b-6b97d311ee6c"> <value><![CDATA[<p style="text-align: justify;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>]]></value> </textarea> <image identifier="ffcc1c50-8dbd-4115-b463-b43bdcd44a57"> <file><![CDATA[images/stories/red/cars/autobedrijf.png]]></file> <title/> <link/> <target/> <rel/> <lightbox_image/> <width><![CDATA[250]]></width> <height><![CDATA[187]]></height> </image> <text identifier="4339a108-f907-4661-9aab-d6f3f00e736e"> <value><![CDATA[Kramer 5]]></value> </text> <text identifier="ea0666d7-51e3-4e52-8617-25e3ad61f8b8"> <value><![CDATA[6000 RS]]></value> </text> <text identifier="90a18889-884b-4d53-a302-4e6e4595efa0"> <value><![CDATA[Eindhoven]]></value> </text> <text identifier="410d72e0-29b3-4a92-b7d7-f01e828b1586"> <value><![CDATA[APK Pick up and return]]></value> </text> <text identifier="45b86f23-e656-4a81-bb8f-84e5ea76f71f"> <value><![CDATA[15% korting op grote beurt]]></value> </text> <text identifier="3dbbe1c6-15d6-4375-9f2f-f0e7287e29f3"> <value><![CDATA[Gratis opslag zomerbanden]]></value> </text> <text identifier="2e878db0-605d-4d58-9806-8e75bced67a4"> <value><![CDATA[Gratis abonnement of grote beurt]]></value> </text> <text identifier="94e3e08f-e008-487b-9cbd-25d108a9705e"> <value/> </text> <text identifier="73e74b73-f509-4de7-91cf-e919d14bdb0b"> <value/> </text> <text identifier="b870164b-fe78-45b0-b840-8ebceb9b9cb6"> <value><![CDATA[040 123 45 67]]></value> </text> <text identifier="8a91aab2-7862-4a04-bd28-07f1ff4acce5"> <value/> </text> <email identifier="3f15b5e4-0dea-4114-a870-1106b85248de"> <value/> <text/> <subject/> <body/> </email> <link identifier="0b3d983e-b2fa-4728-afa0-a0b640fa34dc"> <value/> <text/> <target/> <custom_title/> <rel/> </link> <relateditems identifier="7056f1d2-5253-40b6-8efd-d289b10a8c69"/> <rating identifier="cf6dd846-5774-47aa-8ca7-c1623c06e130"> <votes><![CDATA[1]]></votes> <value><![CDATA[1.0000]]></value> </rating> <googlemaps identifier="160bd40a-3e0e-48de-b6cd-56cdcc9db892"> <location><![CDATA[50.895711,5.955427]]></location> </googlemaps> </elements>'; We are building a site for users to post articles on certain topics and we want to show their number of followers on various social media platforms. Apart from them having the means to add it manually, there must be a method of syncing with their account, that they punch in, so that it dynamically updates our database with their number of followers. How is it done? Hi phpfreaks, please I have being working on a media site for few months now and I have designed everything that needs to be designed but A♏ having problems with my uploading code its not storing the file size in the database, I have tried and tried and all what have being doing seem to be taking me away from the right way with my little understanding of php. Here is the code that is giving me headache , <?php //include("includes/sess.php"); ?> <?php $upload="active"; include("includes/mheader.php"); ?> <?php if(isset($_POST['Upload'])) { ////////////////////////////////// //$id=$_POST['id']; $picture=$_POST['picture']; $artiste=$_POST['artiste']; $title=$_POST['title']; $genre=$_POST['genre']; $uname=$_POST['uname']; if($title=="") { $message="unknown Title"; header("location:upload.php?message=$message"); exit(); } if($genre=="") { $message="unknown Type"; header("location:upload.php?message=$message"); exit(); } /*if($nfile=="") { $message="file not found"; header("location:upload.php?message=$message"); exit(); } */ if($uname=="") { $message="error you"; header("location:upload.php?message=$message"); exit(); } if($artiste=="") { $message="Artiste ?"; header("location:upload.php?message=$message"); exit(); } header("location:upload.php?message=$message"); ////////////////////////////////// $size=$_FILES["picture"]["size"]; $file_size1 = $size/1024 ; $file_size = $file_size1/1000 ; function UploadOne($fname) { $uploaddir = 'music/NaijaMp3_'; if (is_uploaded_file($fname['tmp_name'])) { $filname = basename($fname['name']); $uploadfile = $uploaddir . basename($fname['name']); if (move_uploaded_file ($fname['tmp_name'], $uploadfile)) $res = "File " . $filname . " was successfully uploaded and stored.<br>"; else $res = "Could not move ".$fname['tmp_name']." to ".$uploadfile."<br>"; } else $res = "File ".$fname['name']." failed to upload."; return ($res); } ?> <?php if ($_FILES['picture']['name'] != "") { $res = UploadOne($_FILES['picture']); $filname = $_FILES['picture']['name']; $filname=addslashes($filname); ///////////////////////////////////////////////////////////// $alt_file_name = "NaijaMp3_" .$filname ; $date_created=date("Y-m-d h:i:A"); include("includes/db_connect.php"); $sql="INSERT INTO upmp3(uname,file_name,alt_file_name,file_size,artiste,title,genre,date_created) VALUES('$uname','$filname','$alt_file_name','$file_size','$artiste','$title','$genre','$date_created')"; mysql_query($sql) or die (mysql_error()); $message="Upload Sucessful"; ///////////////////////////////////////////////////////////// echo ($res); } } ?> <div class="main_but"> </div> </div> <!-- Navigation begins here --> <!-- Header section ends here --></div> <div class="login"> </div> <div id="feature"> <blockquote/> <div align="center"><em><strong>UPLOAD FILE </strong></em></div> <form action="upload.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> <br /> </p> <p>{Note: All * fields are Mandatory} </p> <p> <label> <input name="picture" type="file" id="picture" /> </label> </p> <p>File Type <label> <select name="type" id="type"> <option value="mp3">mp3</option> </select> </label> </p> <p>Artiste*<span class="style1"><sub>(e.g Alashine)</sub></span> <label> <input name="artiste" type="text" id="artiste" /> </label> Title <label> <input name="title" type="text" id="title" /><span class="style1"> </label> <p>Genre <label><input name="genre" type="text" id="genre" />(Genre e.g Hiphop, RnB, Reggae . . .)</span></label> <input type='hidden' name='id' value='<?php echo"$id" ?>' id='id'/> <input type='hidden' name='uname' value='<?php echo"$uname" ?>' id='uname'/> <label></label> </p> </p> <p> <label> <input name="Upload" type="submit" id="Upload" value="Upload Mp3" /> </label> </p> </form> </div> </div> <?php include("includes/footer.php"); ?> </div> Thanks for your help in anticipation I'm learning to develop social media buttons, and I'm trying to figure out, how to find out the correct submit links to the social media sites? For example: Digg has their submit link like this: return "<a href='http://digg.com/submit?url=$link& title=$title&bodytext=$text'>Digg This</a>"; Digg also requires to use urlencode for the variables inside the URL. But delicious has their submit link like this: return "<a href='http://del.icio.us/post?url= $link&description=$text&replace=no'>Add to Delicious</a>"; When I go on delicious.com (under this URL: http://www.delicious.com/help/api#posts_add) I will find the link: Code: [Select] https://api.del.icio.us/v1/posts/add? Which is stated on the API page, but that link won't work. I rather have to use the link I showed earlier. So my question is, what is the proper way in figuring the correct submit links for each website and how to format them properly to their requirements, I can not find any information on the websites? So I can build social media buttons to the other sites as well. can anyone tell me whats this player and the settings for playing mp3 files with this player thanks http://img146.imageshack.us/i/84129977.jpg hey back again, I need help finding something like the audio player found at www.soundowl.com. I need it to be similar in the sense that the URL of the file cannot be found in the source code and this is exactly what I need for my website, any help will be appreciated, thank you in advance This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=314887.0 Hello everybody,
I am honestly quite a newb when it comes to mod_rewrite.
We run a small social media page with different areas and I would like to change the URLs to something more clean and professional.
User profiles look like this:
http://www.sky-mp3.com/index.php?action=cm&siteid=59&wahl=artists&tat=details&keyid=477siteid 59 is the artists list and the keyid at the end is the ID of the artist but should be like: http://www.sky-mp3.com/mischuraor in worse case like: http://www.sky-mp3.com/user/mischuraCMS pages look like this: http://www.sky-mp3.com/index.php?siteid=106but should be like: http://www.sky-mp3.com/charts(page name instead of siteid) What I know so far: - I have to add something to the .htaccess file - I need to change something in the code (but I don`t know where) Im good he? What would be the first step on the path to clean URLs for me? I found alot of infos here and there but found nothing yet for this specific case. Kind regards from and thx in advance from Cologne Hello Peeps Let's see if i can get out what i need to ask. Origin for Question: I have started to get into making Music. I create it(incomplete songs) on one pc and then normally have to upload it to the web and download it on another pc hooked upto a stereo and sound system. What i would prefer: I would like to make it on one pc and then upload it to a site and then the other pc can just goto the site like.. mysite.com/play.php?id=4 The Question: What would i need to look up for the best way to be able to upload and then play the song. i would not want to have it so i upload it and have to download it but rather i can go to a page as quoted above and there is simply a song playing there. i would like it to do something like the following * mySite.com has an upload section * when the file is uploaded it is saved as $id.mp3 (so first upload is 3 snd upload is 4.mp3 and so on.) on that note i'm also thinking of having it so i have to be logged in so then i can have $username-$id.mp3 *i would then like it to display the link.. ( Thankyou your upload is complete. your link is mysite/play.php?$username-$id.mp3) *then on that play page i would like a player that can load the song and play it by the vars.. so it looks for the $id and $username vars and then plays the file with that name. So i'm not asking for anyone to build this. i want to build it but i'm not sure what to look up for this. i feel i could so far do the login and research the upload and saving file names But its the music player side im confused on is there something out there in jquery or something maybe? i do not want to use flash.. i dont think :S I hope this makes sense and hope someone can help. Thanks I confess I am not a php coder but have managed to build a youtube player which plays from a list which is generated by a flat file data base. http://www.d-sine.com/DEV/CHW/movies/index.php I have also (nearly) built an admin backend where users can edit the database and add, delete and update their movie player list. http://www.d-sine.com/DEV/CHW/movies/admin/ pass = password the problem I have is that when the list is edited it throws in a return (a blank line) into the database resulting in an error when the player is refreshed after the change. When this blank line is taken out all is fine, I have got so close its frustrating arrrgghh Can anyone help??? The code in full is attatched Open Source, so if it is any use to anyone, be my guest ;-) For some reason, I can get this file to play in the web browser, but I can not get it to play in my flash player. File: http://envne.com/music/play.php?id=23156 The file is a file that uses cURL, to load the song from the saved url. I am thinking that it is a cURL thing, because when displayed in my google browser, the load bar doesn't load on my page, but on the link below it does display I use other songs in the same flash player by just linking to a different id number and those songs play fine in the player. Why does this song do this, and others don't? File on the web: http://kickkicksnare.com/wp-content/uploads/2010/05/Like-a-G6-Ft.-The-Cataracs-Dev.mp3 The PHP: $ch = curl_init(); header('Content-Type: audio/mpeg'); curl_setopt($ch, CURLOPT_URL, $row['url']); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_FRESH_CONNECT, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_exec($ch); header("Content-Transfer-Encoding: binary"); header("Content-Type: ".curl_getinfo($ch, CURLINFO_CONTENT_TYPE).""); header("Content-Length: ".curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD).""); curl_close($ch); Hoping someone could help me with hiding a video player if a video is not present in the db. I have split up the code to make it easier to understand. Thanks in advance (int) $ListId=$_GET['ListID']; function mysql_resultTo2DAssocArray ( $result) { $i=0; $ret = array(); while ($row = mysql_fetch_assoc($result)) { foreach ($row as $key => $value) { $ret[$i][$key] = $value; } $i++; } return ($ret); -------------------------------------------------------------------------------------------- $querys = mysql_query("SELECT * FROM video WHERE listingID = '$ListId' "); $Details_video=mysql_resultTo2DAssocArray ($querys); -------------------------------------------------------------------------------------------- <div class="right_col"> <p id='preview'>The player will show in this paragraph</p> <script type='text/javascript' src='/flvPlayer/swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('/flvPlayer/player-viral.swf','player','280','200','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('autostart','true'); s1.addParam('image','/flvfiles/<?php echo $Details_video[0]['imagePath']?>'); s1.addParam('flashvars','&file=/flvfiles/<?php echo $Details_video[0]['videoPath']?>&image=/flvfiles/<?php echo $Deatls_video[0]['imagePath']?>&dock=false&autostart=true'); s1.write('preview'); </script> |