Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2006
    Posts
    5

    Pass a filename to a Media Player page?

    Is it possible to make *one* global media player page and have a bunch of labels that call it but specify different files? Or if I have 500 files on the CD do I have to make 500 pages that are the same except for the filename?

    Thanks

  2. #2
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    Yes. Just set a global variable with the file path that you want to open, and use actions to load that file into the object.

    What kind of files do you mean?

    For video files, you can use the Video.Load action. For HTML files you can use the Web.LoadURL action. For flash files you can use the Flash.Load action, etc.

    (Great name btw. )
    --[[ Indigo Rose Software Developer ]]

  3. #3
    Join Date
    Aug 2006
    Posts
    5
    Nothing else I tried was free, I was going to call myself "NoGoodNamesLeftHere" but I thought it might be misinterpreted as anger.

    Specifically, MP3 files in the WMP plugin. I've got a good 500 or so (all legal, don't worry!) and I'd rather not make 500 WMP pages. Can you give me a hand as to how I have to set up that page and how to pass info to it in links?

    Thanks

  4. #4
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    I have a feeling one of our users might have an example of something along those lines that they could share...

    Do you want the list and the player on separate pages, or on the same page?
    --[[ Indigo Rose Software Developer ]]

  5. #5
    Join Date
    Aug 2006
    Posts
    5
    The player can be one separate page and the list will be over multiple pages, but never the player page.

  6. #6
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    In that case, just use a global variable to hold the current mp3 file. (You could use additional variables to hold other information, like the track name, and stuff.)

    So, for example on page 1, someone clicks one of your labels, in that On Click event you'll have code like:

    Code:
    g_strCurrentFile = "AutoPlay\\Audio\\Imogen Heap\\05 Hide and Seek.mp3";
    g_strCurrentTrackName = "Hide and Seek";
    g_strCurrentArtist = "Imogen Heap";
    And then on your player page, you put actions in the On Show event to load that file into media player plugin and start playing it.

    Code:
    MediaPlayer.Load("Player", g_strCurrentFile); -- change "Player" to actual object name
    MediaPlayer.Play("Player");
    -- could set some label objects to show the track and artist, like so:
    Label.SetText("labelTrack", g_strCurrentTrackName);
    Label.SetText("labelArtist", g_strCurrentArtist);
    If you don't want the track to start playing automatically, you could remove the MediaPlayer.Play() action and use buttons on the player page instead.
    --[[ Indigo Rose Software Developer ]]

  7. #7
    Join Date
    Aug 2006
    Posts
    5
    That seems like it's going to work just fine. Thank you!!

  8. #8
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    You're welcome. Let me know how it turns out!
    --[[ Indigo Rose Software Developer ]]

  9. #9
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Starting from a point where you have a m3u file which represents your mp3 files. This would be a text file where each mp3 file (meaning its complete path) occupies one line of text.

    Attached is a very quick example (using the AudioPlayer Template).

    Yossi
    Attached Files

  10. #10
    Join Date
    Aug 2006
    Posts
    5
    Quote Originally Posted by Lorne
    You're welcome. Let me know how it turns out!
    It works PERFECTLY! Just what I needed. If I have some extra time I'll hide the WiMP interface and add a progress bar, but it does what I need it to do!

    Thanks for keeping me sane and ahead of schedule.

  11. #11
    Join Date
    Dec 2003
    Posts
    891
    Here is a music player that has a lot of features that several of us here put together back in November.
    You may get a lot of ideas from it
    Attached Files
    Last edited by Roboblue; 08-09-2006 at 04:25 PM.

Similar Threads

  1. Media Player 9.0 Issues in AMS40
    By Brett in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 01-23-2003, 10:26 AM
  2. INFO: Difference between the Media Player Object and the AVI Object
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-29-2002, 02:15 PM
  3. HOWTO: Create a Page Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-26-2002, 05:20 AM
  4. HOWTO: Make a Media Player Object Go Full Screen
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 11:23 AM
  5. Replies: 0
    Last Post: 10-04-2002, 10:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts