Open URL instead of file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • hammerstein
    Forum Member
    • Feb 2005
    • 12

    Open URL instead of file

    Don't know what I'm doing wrong, easy enough to open a file, but to open remote file (i.e. url online) is not working for me. Here's what I have to open file, but it doesn't remember last folder... I want also, option to open remote file from internet:

    -- Display a File Browse Dialog, and then play the video that they select

    -- Pick a nice default folder to start the browsing in (My Documents)
    myfolder = Shell.GetFolder(SHF_MYDOCUMENTS);

    -- Show the file browse dialog
    tFiles = Dialog.FileBrowse(true, "Load Video", myfolder, "Video Files (*.mpg;*.mpeg)|*.mpg;*.mpeg|MPG (*.mpg)|*.mpg|MPEG (*.mpeg)|*.mpeg|","", "", false, true);

    -- Only load the video if they did not press Cancel
    if tFiles[1] ~= "CANCEL" then
    -- make sure the Video object is visible before trying to load a video
    Video.SetVisible("Video1", true);

    -- Load the video File
    Video.Load("Video1", tFiles[1]);

    -- Play the video
    Video.Play("Video1");

    -- Adjust the Play/Pause button text
    Button.SetText("pause", "PAUSE");
    end


    Any help will be appreciated, thanx much.
  • Intrigued
    Indigo Rose Customer
    • Dec 2003
    • 6138

    #2
    Open a link online that is a video link?

    If so, try something like this:

    Code:
    Video.Load("Video1", "ftp://ftp.tek.com/tv/test/streams/Element/MPEG-Video/525/100b_015.m2v", true, false)
    Intrigued

    Comment

    • Intrigued
      Indigo Rose Customer
      • Dec 2003
      • 6138

      #3
      Here is a code (sample) chunk for the other setback (save the path chosen to load to that path again):
      Code:
      -- Display a File Browse Dialog, and then play the video that they select
      -- Pick a nice default folder to start the browsing in (My Documents)
      [B]if tFiles ~= nil then
      	-- Show the file browse dialog
      	tFiles = Dialog.FileBrowse(true, "Load Video", myfolder, "Video Files (*.mpg;*.mpeg)|*.mpg;*.mpeg|MPG (*.mpg)|*.mpg|MPEG (*.mpeg)|*.mpeg|","", "", false, true);
      else
      	myfolder = Shell.GetFolder(SHF_MYDOCUMENTS);
      		tFiles = Dialog.FileBrowse(true, "Load Video", myfolder, "Video Files (*.mpg;*.mpeg)|*.mpg;*.mpeg|MPG (*.mpg)|*.mpg|MPEG (*.mpeg)|*.mpeg|","", "", false, true);
      end[/B]
      
      -- Only load the video if they did not press Cancel
      if tFiles[1] ~= "CANCEL" then
      -- make sure the Video object is visible before trying to load a video
      Video.SetVisible("Video1", true);
      
      -- Load the video File
      Video.Load("Video1", tFiles[1]);
      
      -- Play the video
      Video.Play("Video1");
      
      -- Adjust the Play/Pause button text
      Button.SetText("pause", "PAUSE");
      end
      
      [B]myfolder = tFiles[1];[/b]
      Intrigued

      Comment

      • hammerstein
        Forum Member
        • Feb 2005
        • 12

        #4
        Need more please...

        Intrigued. thanx for the help, but the remember last folder opened, only works while video player is running. Once program is closed and reopened, it goes back to the My Documents folder, I want it to where next time program is ran, it will remember last folder open if possible.

        The other problem, opening a remote video, i.e. from internet stream, e.g. http://www.mysite.com/video/xyz.mpg , it didn't work. Sorry to ask for so much, I don't know how something so simple has puzzled me such.

        Thanx for any and all help.

        Comment

        • JimS
          Indigo Rose Customer
          • May 2003
          • 1057

          #5
          To remember a ‘last file path’ the next time you run the program, you’ll need to write it down somewhere. You could use a text file, an .ini file, or registry key, as the place to write your path info down.

          Easiest way to do what you want, is to check out the actions Application.SaveValue and Application.GetValue



          .

          Comment

          Working...
          X