A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: SharedObject to play video only once?

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    11

    SharedObject to play video only once?

    I need a video to play automatically on the first page load and then require clicking a play button when returning to the page. This will save me a ton of bandwidth and prevent visitors from getting annoyed each time the page is reloaded/revisited. Of course, once the browser is closed and the session ends, the video will play automatically again the the process will repeat.

    I'm using the TinyVid player and know that I need to use "SharedObject" but I have no idea what to code or where to put the code. Any help would be appreciated. Thanks!

  2. #2

  3. #3
    Junior Member
    Join Date
    Jan 2009
    Posts
    11
    Thanks Chris. Unfortunately, the video http://www.km-codex.com/?p=535 will not auto play on the first page load. I tried in IE and Firefox, cleared cache, closed and reopened browser and still no luck. Any ideas?

  4. #4
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Download the source in my code section. I'm using a remote video (an adobe cuepoint example one actually linked in tons of sites) and you can test it/tweak it using your actual video that way on your server.

  5. #5
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    worked for me. Autoplayed first visit, left came back didn't play

  6. #6
    Junior Member
    Join Date
    Jan 2009
    Posts
    11
    I need the video to auto play once again after a new session of closing and opening a browser. Do I need to clear some kind of flash cache or something? the example video at http://www.km-codex.com/?cat=4 will not "reset" and auto play no matter what I do. It might have worked the first time but now it seems to be stuck.

    Example:
    1. I open my browser.
    2. I go to http://www.km-codex.com/?cat=4
    3. Video does not auto play. (It should, right?)
    4. I close my browser completely and open a fresh browser.
    5. Video still does not auto play.
    6. I go, "Huh?"

  7. #7
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    It's doing exactly what you requested originally..

    "I need a video to play automatically on the first page load and then require clicking a play button when returning to the page."

    Now you are saying you want it to be session based but also stored via sharedobject which is not the same as the above request.

    I say again, download the source...study it as it uses a very simple shared object and will help you at least understand that aspect...and work out some sort of routine based on it that utilizes both sessions (or timestamps or etc) and sharedobject. Or...go a completely different route.

    As it stands, it is doing what it is supposed to as originally coded to match the request quoted above.

  8. #8
    Junior Member
    Join Date
    Jan 2009
    Posts
    11
    Thanks.
    Last edited by Markalark; 06-21-2009 at 02:34 AM.

  9. #9
    Junior Member
    Join Date
    Jan 2009
    Posts
    11
    Sorry for the confusion. I'm in over my head here. I do appreciate your help and will study your code and do more research to figure things out. Thanks again.

  10. #10
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    If you want to remove the sharedobject that movie creates, use the "clear" method in some other logic throughout the movie

    mySO.clear( );

    that completely removes it from the end users system

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