Nov 22, 2009

How To Embed Ram File Produced By Http Header

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

How To Embed Ram File Produced By Http Header

vicky99
Dear Friends
I want to stream music from my website. The file format is .rm. People say that one need a Helix Server or other media server to stream. I have found a solution to this problem as well. I read an article about streaming music. It tells that if the size of the media file is small and the byte rate of the media file is lower than that of the user internet connections byte rate, the file get streamed automatically from HTTP
server.
In theory, any file is "streamed" by a web server that is, sent back to the client in small pieces. What makes
media files special is that a media player can start playing the file even before it receives the full file. However, supposing the media player downloads one second of music, and plays it, and the data for the next second has not yet been downloaded, it will stop immediately. You will have to click Play again. However, if the bit rate of the media file is less than the bit rate of the connection, the player will always be able to download faster than play, and so, while there may be delays in playing the media, it won't stop.
I have uploaded couple of files on the server and they are working. But in my endeavor of making a contemporary online music website I am facing many problems which are as follows:-
I am using object and embed tag to play music in WebPages. I have created a RAM file which contains the links of the media files i.e. RM files. The RAM file is embedded to the web page e.g. <embed src=”http://server/ramfile.ram “>. Up to this point everything is under control. Now I want to let my users choose multiple songs. To do that, I used check box to select more that one song. I used query strings to send the links or id of the selected songs and retrieved the urls on the page where the songs would be played. Here the problem arises. How can I add multiple url to embed tag.
I found out a solution but it did not work. My idea was to create a RAM file (Many of you guys may already know about it yet I would like to explain the phenomenon. One can create a RAM file which may contain more than one media file links. For example, aramfile.ram may contain both http://server/a.rm and http://server/b.rm. If such a RAM file is embedded to a web page multiple songs can be played in a random manner) dynamically which would contain the list of links we received from query string. But with PHP, one cannot create a file on web server nor can open a file with write option. According to me it was the best possible solution but it is not feasible. I know that many professional personal employ this method. How they do it is mystery to me.
Then I began my search to find a way out. Fortunate I found out a way. Answer to my problem was HTTP HEADER. I would like to share what I understand about HTTP HEADER before I proceed.
Using headers server and browser communicate. Server sends headers before sending any other data.
Headers can contain many types of information and instructions that the server and browser use to help each other know what to do next.
Further PHP can be used to manipulate headers to get desired output. Using the following the codes one can create a ram file.
header("Cache-control: public");
header("Content-Type: audio/x-pn-realaudio ram;");
header("Content-Disposition: filename=a.ram");
echo $fres;
exit();
It did work. But in external player. I could not play the song inside the web page. So, friends I would be very grateful if some one helps me out …..

 

 

 


Comment/Reply (w/o sign-up)

Hercco
You explained your system well but not the actual problem. What errors you get when you try to open the RAM file with a player? Are you absolutely sure that the PHP script that outputs the RAM file produces correct code?

If you have static RAM file that contains the SMIL code (that's SMIL right?) and a PHP file that outputs the exact same contents with HTTP headers, my opinion is that they should work in completely same way. Only problem that I can come up with is the media player which refuses to treat file with php extension as RAM, although the MIME type is correct. Check the player settings or try another one.

Comment/Reply (w/o sign-up)

vicky99
Thank you very much..!
Sir Hercco, Today I would try to explain the problem.
I have created a system for playing music online. When a user clicks the link of the music file a pop up window appear and plays the song. I send the id of the song using query string and receive it and then get the link of the song from database. It works fine. Then in my last post, I mentioned that I want to provide my user with the facility to select multiple songs which would be played sequentially. For that, I used checkbox and send ids in the same manner I did previously. I then queried the database and received the links to the songs.
Now, how to play these songs in a sequential order? This is the base problem. I have employed various methods but failed to achieve the goal.
One of the methods was to use PHP header function. Using it I got very near to my goal. I could play the selected songs sequentially but in an external player (interface). I want to play the songs within the web page (in the pop up window mentioned above).
If you want to know what I did please let me know .I would post my codes here. I hope to hear from you very soon.
With Regards

 

 

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : embed, ram, file, produced, http, header

  1. Extplorer
    A PHP -and JavaScript- based File Manager (7)
  2. Php File Upload
    About uploading files through php (3)
    Right i have done a check for a tutorial on this as well as a question about it but php is not
    allowed in the search box. So i thought i'd just ask what i want to know. I have a form which
    uploads a file, it refreshes the page, uploads the file and then alerts the user to if the file has
    uploaded. To be honest im not sure why i keep getting the error. But here is the code: This is the
    form that is used for the user to select the file &fid= " method="POST"> Choose a file to
    upload: This is the upload code if ($op == "up"....
  3. Help: Removing A Specific Header With cURL
    (0)
    Hi all, I' ve problem sending HTTP POST(multipart/form-data) request using CURL. The server
    always reply with HTTP/1.1 417 Expectation Failed . Then I review my code and the tcp packet using
    wireshark for long long time /sad.gif" style="vertical-align:middle" emoid=":(" border="0"
    alt="sad.gif" /> just to figure out where is the error!. This problem only for one site and for the
    others site my script works perfectly!. here is my packet that sent to the server CODE POST
    xxxxxxxx HTTP/1.1 Cookie: PHPSESSID=447c6f5c9e73c22a1bf50dd46940306e Host: www.xxxxxxxxxx....
  4. Automated File Structure Creation Script
    As Requested By Mark420 (3)
    While chatting with Mark420 today on the shoutbox, he mentioned that he was looking for a script to
    create his entire folder structure with just a click of a button. For example, he wanted the
    following folders created in his root folder by just clicking submit. /images /images/thumbs
    /images/icons /css /javascripts /content /content/articles /content/tutorials Presumably this
    would be used for some type of installation system or other quick server setup situation. Anyhow
    here is what I threw together for him: /* ********************************************....
  5. How To Force A Zip File To Be Downloaded
    (11)
    Hi, i have a problem with a zip file that i want to be force downloaded by any client, i know that
    with the header function it can be achieved but dont know why it doesnt works. I have two files, the
    first one is a simple html file with an a tag and the second is a php file, here is my code: html
    file: CODE Download File Php file: CODE header('Content-Type:
    application/zip'); header('Content-Disposition: attachment; filename="file.zip"');
    readfile('downloads/file.zip'); ?> May be i forgot something, does it is necessary to ....
  6. How To Delete File Using PHP Shell Script
    (3)
    i have this problem regarding file access seems that my admin host or the server system itself have
    locked up the acces to create new file, delete a file.. change file permissions and such controls
    to file.. someone told me to use php shell script.. can you help me out here? ******** i just
    need to find out how to use php shell script and add it to my php scripts to delete a file.. thanks....
  7. Need An Alternative To $http_post_data For PHP4
    (5)
    Hi, my client's host site currently hosts just 4.0. I tried using the
    file_get_contents("php://input") and $HTTML_post_data php file to save the XML file from Flash but
    when loaded, it returns nothing. I need hlep....
  8. File Self Secure?
    is it avaible (6)
    I just learn php. We store the pass word of Mysql in a file right. So is there any way to may a pass
    protect that file . i mean they could hack and find out the place of the file (ex like in forum) and
    drop all sercure data /huh.gif" style="vertical-align:middle" emoid=":huh:" border="0"
    alt="huh.gif" />....
  9. Updating An Rss File Using A Php Form
    (1)
    Hi, I'm currently making a site for my organization but I'm stuck on this one section where
    I would have to make a PHP form in order for other members to post an item into my RSS file. So does
    anyone know a PHP script I can use in order for me and other members to input a new RSS item into my
    news RSS file?....
  10. Xgrid With Php
    Creating a script to post a blender file to Xgrid using PHP (0)
    I am doing pre planning for the blenderxgrid.com script. I was originally going to do this with
    PERL, but elected against it. Eventually I'll be moving the site off astahost and replacing it
    with a website hosted on the same machine as the xgrid controller. I am setting up a test version
    on my latop using OSX's apache server, MySQL, and PHP on a localhost config. Here is my step
    list for the script: ------------------------------------- Form: (within Xoops CMS, so user will
    have to be logged in) Username Password (where they can upload the .blend file....
  11. Generating A Table Into A File In CSV Format
    and letting user download the file (6)
    I'm working on a project, part of which consists of working with large tables of different
    kinds. Now, I'm using a page seeking technique which allows you to browse through the records
    depending on which page you want to see and how many records you want to see on each page. Now, I
    need a link (or a form button) on each page which, when clicked, will throw a file to the user for
    download (the download window should popup immediatly) which will give the part of the table,
    currently being viewed, in CSV format. One way I can think of to generate the file is manu....
  12. PHP Script To Upload A File
    with password-protection. (15)
    Problem: Upload a file to the AstaHost account (that I have been granted here) throught the
    webpage I would like to know, how should I proceed on this particular problem. I know this has
    been done through cPanel, but I want to write a PHP functionality. The cPanel is accessed through
    the 2082 port, and most of the places I access internet from does not give me access through that
    port. I can access http://www.kmaheshbhat.astahost.com/ but not
    http://www.kmaheshbhat.astahost.com/cpanel or http://www.kmaheshbhat.astahost.com:2082/ . I need
    to go to one particu....
  13. Display Text If Line Not Empty In Config File
    (8)
    I have been working on a new template and I would like it so that if in the global configuration
    file, I have a variable for a global site announcement that would go on every page. The line in the
    global configuration file is this: CODE $announcement = "ANNOUNCEMENT"; In my template file,
    I could easily add CODE but that would leave a blank space and with the announcement style
    (similar to the Invision Power Board error box). Is there some sort of script that could be put in
    the template page so I could have the global config file look something like t....
  14. PHP File Upload Works... But Stupid IE
    (3)
    ok i have used the following code in my upload.php file Code: CODE $uploaddir =
    '../photos/'; $uploadfile = $uploaddir . basename($_FILES ); echo ' '; if
    (move_uploaded_file($_FILES , $uploadfile)) {   echo "File is valid, and was successfully
    uploaded.\n"; } else {   echo "Possible file upload attack!\n"; } using ../photos/ as my
    upload DIR works, as the file does upload, but when i echo $uploadfile on the same page: Code:
    CODE " alt="uploadedfile" /> IE wont show it as it has two fullstops before the photo dir
    in the domain....
  15. Http Headers
    (3)
    I know you can use the header() function to send http headers. But I want to know if it is possible
    to simply echo them, like you can print them in perl. Also, is it possible to create a non-expiring
    cookie. Most sites that have a remember me option imply set the cookie to expire in a year or two,
    but it will eventually expire. Is it possible to create a cookie that never expires? ~Viz....
  16. Online HTML/PHP Editor: Edit File In Browser!
    (11)
    Im wondering how you can load a file into a text area and edit it. Lets say i have a php file called
    test.php and id like this file to be loaded into a textarea and the user should be able to edit this
    file and store it. Is this posible? Im also wondering how you make it so the html dosnt get
    encoded by the browser, lets say i need to explain on my website how you use html. CODE Just
    testing something, maybe i can get this from the source. ....
  17. Counter With Img In Flat File
    (2)
    this is a counter with images and stor in flat file becouse i can not upload .zip .rar file iwell
    program it on this post at frist you need to 2 files count.php count.txt and you need else make
    folder has name gifs and make 10 pictuer 10 file 0.gif to 9.gif now all ok open the count.php and
    add this code CODE ### IMAGE FORMAT $format = ".gif"; $file = file("count.txt"); $num =
    ($file + 1); exec("echo $num > count.txt"); switch($type) { case "text":  echo $num;  break;
    case "gfx":  $i = 0;  $cntn = strlen($num);  while($i   $tmpnum = subst....
  18. Php Reading And Writing To File
    the code is very esay (4)
    this code to Read from file you can use this code in to make a small data base and it is very to
    use CODE $fp = fopen ("file.txt", "r"); $bytes = 4; $buffer = fread($fp, $bytes); fclose
    ($fp); print $buffer; ------------------- to write to same file CODE $fp = fopen
    ("file.txt", "w+"); fwrite ($fp, "Test"); fclose ($fp); ---------------- thanks and iwait the
    commant....
  19. Php Script To Download File From Another Site
    (11)
    hi i need a php or java script code for downloading files from other sites to my site for example:
    http://download.com/file.zip to http://mysite.com/file.zip thanks....
  20. Random Image / Random Header
    S.O.S. (5)
    im building a website, and i need some help i got 3 frames, navigation, top and main, but i want
    the top banner to have a new tagline with every refresh, just like the header, it dont really matter
    what coding it is, as long as it's not to weird /tongue.gif" style="vertical-align:middle"
    emoid=":P" border="0" alt="tongue.gif" />....

    1. Looking for embed, ram, file, produced, http, header

See Also,

*SIMILAR VIDEOS*
Searching Video's for embed, ram, file, produced, http, header
advertisement



How To Embed Ram File Produced By Http Header

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com