Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 14 of 14
  1. #1
    Join Date
    Aug 2004
    Location
    Elgin, Illinois, USA
    Posts
    84

    Huh? Attaching the Slider plug-in to my video

    Hi again.

    Okay, I got my page with a panel on it and inside the panel is my video object minus the player control panel as I need my own customized controls.

    Got all the buttons set and now on to the slider. So how do I connect the slider to my video so the slider moves in relation to the video?

    Can't seem to find any help on this one. I was looking at the script actions but don't quite understand them yet. I'm working on it!

    Thanks
    Allen

  2. #2
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    allenz, I updated the VideoSeek .apz file I shared with you a while back. It may be what you need. You can find the code in the Page1's On Timer event tab.

    VideoSeek (link is in the thread)

    Notice how the timing is off a tad though? Well, try it out and see what you can make of it. Good Luck!

    Sincerely,
    Last edited by Intrigued; 10-02-2004 at 09:05 PM.
    Intrigued

  3. #3
    Join Date
    Oct 2004
    Posts
    6
    I just got through putting the slider in my video. I used the on timer function on the page I put it on, then on every timer tick, go get my current video frame, do some math on it to convert it to a desired slider position, then set the slider position. Looks like this:

    -- First I get my current video frame - I'm using Flash, so it looks like this...
    curframe = Flash.GetFlashVariable("Flash2", "_currentframe");
    -- My slider is 1000 units long, totalframes is the total frames in my video
    newpos = 1000*(curframe/totalframes)
    -- Then move the slider
    Slider.SetSliderPos("Time Slider", newpos);

    Hope it helps!

  4. #4
    Join Date
    Aug 2004
    Location
    Elgin, Illinois, USA
    Posts
    84
    Thanks. I'll try out both the suggestions. Haven't got ino the timer yet.

    Allen

  5. #5
    Join Date
    Aug 2004
    Location
    Elgin, Illinois, USA
    Posts
    84
    Quote Originally Posted by Neill Karl
    -- First I get my current video frame - I'm using Flash, so it looks like this...
    curframe = Flash.GetFlashVariable("Flash2", "_currentframe");
    -- My slider is 1000 units long, totalframes is the total frames in my video
    newpos = 1000*(curframe/totalframes)
    -- Then move the slider
    Slider.SetSliderPos("Time Slider", newpos);

    Hope it helps!
    Neill Karl, question. At the "curframe" what do I put? My video is "video1.mpg". I put that in but got an error msg. I also put my video title inside the () replacing "Flash2'. this video is 465 frames so I replaced your 1000 with 465

    I got lost somewhere.
    Allen

  6. #6
    Join Date
    Aug 2004
    Location
    Elgin, Illinois, USA
    Posts
    84
    Intrigued
    I tried your updated project file. There isn't a pause button so I couldn't see if the slider actually would control the video as my sample video is only 15 seconds long. I tried it and it didn't seem to want to control the video. Also I see a large slider on the player itself. I wanted to get away from that.

    Actually I'd like to be able to set the slider to say Mile Posts on a Railroad so if someone moved the slider to MP 4 for example, it would bring the video there and show a frame until they clicked the play button.


    I think Karl's script seems to be what I want but I need to know how to change it from his Flash file to my video file. See my reply to him above.
    Allen

  7. #7
    Join Date
    Aug 2004
    Location
    Elgin, Illinois, USA
    Posts
    84
    Karl
    When previewing the page, and I click on the slider the error message says;
    OnPosChange, Line2: attempt to index global 'video1'(a nil value).

    Can you help on this?
    Thanks
    Allen

  8. #8
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    allenz, try the .apz file again. I have added in some code in the appropriate areas and comments where clarification was, I thought, needed.

    Let me know how this works...

    ps. I just unchecked the slider checkbox option in the page's settings dialog box to rid the video of that feature.

    ps. I did the Play button... I'll let you practice and finish (if you use this version) up on the chapter buttons.

    Sincerely,
    Last edited by Intrigued; 10-04-2004 at 07:39 PM.
    Intrigued

  9. #9
    Join Date
    Aug 2004
    Location
    Elgin, Illinois, USA
    Posts
    84
    I just can't find it. Opened your latest apz file, put my own video in.

    Double clicked on page 1. Only script I can find is "on finish" a script about a btn_state.

    Clicked on the slider (yours not the one on the player) and can find no code. Clicked on the slider text and see no script code.

    Noticed also that the script code for the 'loop' check box is attached to the "loop" text and not the button. Why is that? I would have thought that button code would be attached to a button and not the text label.

    Now the slider on the video player works as I'd like but I can't control or move the video using your added slider. Although the added slider does work by itself. If I try to move the added slider, it jumps back to the current video position.

    Sorry intrigued, I just don't understand your example.
    I want to try Karl's script above as soon as I can figure out how replace his flash reference with my video information.

    Allen

  10. #10
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    I understand allenz... it takes practice... best of luck!

    Sincerely,
    Intrigued

  11. #11
    Join Date
    Oct 2004
    Posts
    6
    The GetFlashVariable that I was using to get my current frame is unique to working with flash. To get the current frame of a video object like your movie, use Video.GetCurrentPos to find out the current time into the movie, and then use Video.GetLength to find out the total length. Then you'll have what you need to calculate your desired slider position. It will look something like this:

    slider_range=Slider.GetRange("YourSliderObjectName "
    curtime = Video.GetCurrentPos("YourVideoObjectName");
    totaltime=Video.GetLength("YourVideoObjectName");
    newpos = slider_range*(curtime/totaltime)
    newpos=Math.Round(newpos,0)
    Slider.SetSliderPos("YourSliderObjectName", newpos);

    Hope it helps!

    Neill

  12. #12
    Join Date
    Aug 2004
    Location
    Elgin, Illinois, USA
    Posts
    84
    Neill
    Oh! Okay and thanks. Now it makes more sense. I'm using my small network computer to check this now as my main computer is processing a video. As soon as it's finished, I will open AMS and change the script.

    Will get back to you later today and let you know if it worked.

    Thanks for clarifying this for me.
    Allen

  13. #13
    Join Date
    Aug 2004
    Location
    Elgin, Illinois, USA
    Posts
    84
    Karl
    Where do put that script? On the slider or the page? I put it on the slider but it doesn't seem to work. It debug's fine and the project previews okay but the slider just doesn't work. However if I put my mouse on the slider and try to move it, I get an error message in the preview.



    Allen

  14. #14
    Join Date
    Oct 2004
    Posts
    6
    Allen,

    Put the slider stuff in the 'on timer' section of the page actions. Then, set up the timer in the 'on show' section. Ticks every tenth of a second will keep it looking smooth. So, in your 'on show' section, put:

    Page.StartTimer(100);

    Now, your code in the 'on timer' section will get executed every tenth of a second while the page is displayed. The slider will keep moving to keep up with the movie.

    Good luck!

    Neill

Similar Threads

  1. Using a slider to show audio posiion in time
    By Randy3265 in forum AutoPlay Media Studio 5.0
    Replies: 16
    Last Post: 01-07-2006, 08:34 AM
  2. Getting a associate video file to open and begin playing.
    By JBS in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 06-04-2004, 09:15 PM
  3. Example: Showing a Wait Dialog While a Video Loads
    By Adam in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-12-2004, 12:59 PM
  4. Online Video Tutorials and CD-ROM Training Series
    By Ted Sullivan in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 05-10-2004, 12:05 PM
  5. Playing a Video using the Embedded Video Object
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 12:36 PM

Posting Permissions

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