A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: pausing the buffer on flash video

  1. #1
    Senior Member
    Join Date
    Sep 2005
    Posts
    128

    pausing the buffer on flash video

    Hi guys here's the problem, I have a video streaming in with a 10 second buffer. I have a button on the player that opens up a side panel and loads in some images. When the user clicks on this button i need to pause the buffering to free up bandwidth.

    What ever is currently buffered will continue to play but nothing new will buffer until i'm done loading the images.

    so how do I pause the buffering? I can't figure it out pls help!

  2. #2
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    can't you write an if statement to change the number of seconds on the buffer to drop down to zero or pause the video untill the pictures load? I mean its definately possible to pause the video if its truly streaming with netStream.pause();
    ~calmchess~

  3. #3
    Senior Member
    Join Date
    Sep 2005
    Posts
    128
    That's the problem, setting the buffer to 0 just means the movie plays immediately as it streams in and netStream.pause(); stops the playhead while the movie still streams in.

    do u know a way to stop the movie from streaming in while what ever is buffered continues to play?

  4. #4
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    well what i mean is after it buffers for say the first 10 seconds then after the 10 seconds you set the buffer to zero it will continue to play then after the pictures load set it back to a 10 second buffer.....I think it can be done with some result but if you don't pause it I have a feeling you will still be using bandwidth because it will just directly stream without buffering I think the only way to stop using bandwidth is to actually stop the netstream.......I could be wrong though tell the buffer to goto 0 then to go back to 10 after the pictures have loaded and pay attention to the bandwidth the entire time then let me know what happened ....defiantely be intresting to know......there is a remote chance that you could cache the video too and then play the cache while the pictures load <<<<really not sure about that though.
    ~calmchess~

  5. #5
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    I'm not sure if you really need to stop the buffering, Flash will try to load the movie and the images at the same time, and unless they're huge images or the user is on a really slow connection, it shouldn't make a huge difference.

    That being said, you could try using Netstream.close() and then when you resume play do Netstream.play (to resume downloading the clip) and then Netstream.seek() to jump back to where you were in the video.

  6. #6
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    sometimes even closing the netstream object does'nt stop it from continuing to download... there's a trick u can use to stop it i.e try to play a non-existent flv e.g

    Code:
    ns.play("thismoviedoesntexist.flv");
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  7. #7
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    sometimes even closing the netstream object does'nt stop it from continuing to download... there's a trick u can use to stop it i.e ask it to play a non-existent flv e.g

    Code:
    ns.play("thismoviedoesntexist.flv");
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  8. #8
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    thats a good idea silent!
    ~calmchess~

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center