Jump to content

Recommended Posts

I have a video on my home page that autoplays. I like the fact the video auto plays the first time you load the home page, but would like to know if there was a way (possibly with session cookies?) to remember if the person made a visit to the home page. If he did (and thus ha already seen the video) the video wouldnt auto load. The video would only auto load the first time a visitor has loaded the home page.

 

Any help or suggestions would be much appreciated! 

Link to comment
https://forums.phpfreaks.com/topic/85047-solved-video-question/
Share on other sites

      <!-- begin embedded QuickTime file... -->

      <table border='0' cellpadding='0' align="center">

        <!-- begin video window... -->

        <tr><td>

        <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="280"

        height="250" codebase='http://www.apple.com/qtactivex/qtplugin.cab' >

        <param name='src' value="http://www.nugentappraisal.com/multimedia/video/Nugent.mov">

        <param name='autoplay' value="true">

        <param name='controller' value="true">

        <param name='loop' value="false">

        <EMBED src=" http://www.nugentappraisal.com/multimedia/video/Nugent.mov" width="280" height="250" autoplay="true"

        controller="true" loop="false" pluginspage=' http://www.apple.com/quicktime/download/'>

        </EMBED>

        </OBJECT>

        </td></tr>

        <!-- ...end embedded QuickTime file -->

        </table>

Link to comment
https://forums.phpfreaks.com/topic/85047-solved-video-question/#findComment-433732
Share on other sites

Try this::::

<?php

// if the cookie variable "visit" is NOT SET
if (!isset($_COOKIE["visit"])) 
{
$time = time();
$autoplay = "true";
// Set The 24 Hour Cookie //
setcookie("visit", "1", $time+60*60*24*1);

} else {

// if the cookie variable "visit" IS SET
$autoplay = "false";
}

?>

 

Then in your table that has the movie embedded:::

<?php
      <!-- begin embedded QuickTime file... -->
      <table border='0' cellpadding='0' align="center">
        <!-- begin video window... -->
        <tr><td>
        <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="280"
        height="250" codebase='http://www.apple.com/qtactivex/qtplugin.cab' >
        <param name='src' value="http://www.nugentappraisal.com/multimedia/video/Nugent.mov">
/////  ADD THE $AUTOPLAY VALUE BELOW //////////////////////////
        <param name='autoplay' value="$autoplay">
        <param name='controller' value="true">
        <param name='loop' value="false">
        <EMBED src=" http://www.nugentappraisal.com/multimedia/video/Nugent.mov" width="280" height="250" autoplay="true"
        controller="true" loop="false" pluginspage=' http://www.apple.com/quicktime/download/'>
        </EMBED>
        </OBJECT>
        </td></tr>
        <!-- ...end embedded QuickTime file -->
        </table> 
?>

 

That may work if your entire site is in PHP......

Link to comment
https://forums.phpfreaks.com/topic/85047-solved-video-question/#findComment-433846
Share on other sites

If it's HTML, but you have to save it as a .php filename if it's not.

 

I didn't even see that PARAM

 

You can also do this with sessions if you don't want to rely on  a cookie.

 


<!-- begin embedded QuickTime file... -->
      <table border='0' cellpadding='0' align="center">
        <!-- begin video window... -->
        <tr><td>
        <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="280"
        height="250" codebase='http://www.apple.com/qtactivex/qtplugin.cab' >
        <param name='src' value="http://www.nugentappraisal.com/multimedia/video/Nugent.mov">
        <param name='autoplay' value=<?php echo $autoplay ?>>
        <param name='controller' value="true">
        <param name='loop' value="false">
        <EMBED src=" http://www.nugentappraisal.com/multimedia/video/Nugent.mov" width="280" height="250" autoplay="true"
        controller="true" loop="false" pluginspage=' http://www.apple.com/quicktime/download/'>
        </EMBED>
        </OBJECT>
        </td></tr>
        <!-- ...end embedded QuickTime file -->
        </table> 

Link to comment
https://forums.phpfreaks.com/topic/85047-solved-video-question/#findComment-433850
Share on other sites

Actually if it IS html and you want to use some PHP and you don't want to change the page extensions..

then just add this to your .htaccess file....

AddType application/x-httpd-php .html .htm .shtml

 

Then put this code above your <html> tag...

<?php

// if the cookie variable "visit" is NOT SET
if (!isset($_COOKIE["visit"])) 
{
$time = time();
$autoplay = "true";
// Set The 24 Hour Cookie //
setcookie("visit", "1", $time+60*60*24*1);

} else {

// if the cookie variable "visit" IS SET
$autoplay = "false";
}

?>

 

Then use revraz's example to display the movie table...

<!-- begin embedded QuickTime file... -->
      <table border='0' cellpadding='0' align="center">
        <!-- begin video window... -->
        <tr><td>
        <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="280"
        height="250" codebase='http://www.apple.com/qtactivex/qtplugin.cab' >
        <param name='src' value="http://www.nugentappraisal.com/multimedia/video/Nugent.mov">
        <param name='autoplay' value=<?php echo $autoplay ?>>
        <param name='controller' value="true">
        <param name='loop' value="false">
        <EMBED src=" http://www.nugentappraisal.com/multimedia/video/Nugent.mov" width="280" height="250" autoplay="true"
        controller="true" loop="false" pluginspage=' http://www.apple.com/quicktime/download/'>
        </EMBED>
        </OBJECT>
        </td></tr>
        <!-- ...end embedded QuickTime file -->
        </table> 

 

Hope that helps...

or better yet hope it is correct seeing as I am a noob...........

Link to comment
https://forums.phpfreaks.com/topic/85047-solved-video-question/#findComment-434312
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.