Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:46:03+00:00 2026-05-29T18:46:03+00:00

I am working on a project that has a Flash video that autoplays once

  • 0

I am working on a project that has a Flash video that autoplays once it loads on the page. My client would like it only to autoplay the first time someone visits the page. Consequent visits (in the same session) would load the video, but keep it paused.

The Flash video has a JS function that I can call to pause or play the video. So my thought was to set a cookie once the user visits the page and have it trigger the callback on consequent visits.

//wait until everything has loaded
$(window).load(function(){

    //set a cookie 
    $.cookie('welcome_cookie', 'welcome');

    //check for the cookie and call the pause function
    if($.cookie('welcome_cookie')){
        controlPlayback('pause');
    }
});

This works, but it pauses the video on the very first time… How do I make it so that the playback function is triggered only on return to this page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:46:03+00:00Added an answer on May 29, 2026 at 6:46 pm

    Just switch order to set the cookie after the first check;

    //wait until everything has loaded
    $(window).load(function(){
    
        //check for the cookie and call the pause function
        if($.cookie('welcome_cookie')){
            controlPlayback('pause');
        }
    
        //set a cookie 
        $.cookie('welcome_cookie', 'welcome');
    });
    

    You probably don´t have to set the cookie on every page load so why not just set the cookie if it´s not set;

    //check for the cookie and call the pause function
    if($.cookie('welcome_cookie')){
        //pause video player
        controlPlayback('pause');
    } else {
      //set a cookie 
      $.cookie('welcome_cookie', 'welcome');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a flash project that has an intro video that plays
I'm working on a project that currently has zero users but we would like
I'm currently working on a project that has a sizable amount of both client
I am working on a project that has a piece of code like the
Working on a project that has a website and a Facebook page. They both
Im working on a project that has an implementation of JOSSO in place. We
I'm working on a project that has two modules: a web and an application
I am working on a project that has a class 'A' that contains a
I am working on a project that has a requirement such that login details
I'm working on a project that has many iframes that are opened and closed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.