JohnOP Posted March 9, 2011 Share Posted March 9, 2011 Hello everyone i have a quick question to ask if i may. On my website i have a presentation video on my homepage, with another 1 just made. What i want to do is when people view my website they see the first video as usual but after that finishes i would like it to switch to the next video which will then replace the first video is that possible in php? Quote Link to comment https://forums.phpfreaks.com/topic/230111-cycle-through-videos/ Share on other sites More sharing options...
JohnOP Posted March 9, 2011 Author Share Posted March 9, 2011 Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/230111-cycle-through-videos/#findComment-1185177 Share on other sites More sharing options...
MatthewJ Posted March 9, 2011 Share Posted March 9, 2011 It depends on how you mean... If you're looking to show a video randomly, sure, just put the video links into an array and pick a random element from it for linking in. If you want someone to see the first video until they have watched it, but then they only see the next video, etc. then you could set a cookie on their system with the id or name of the last vid they watched. Check that cookie when they get back, and load the next video instead. Quote Link to comment https://forums.phpfreaks.com/topic/230111-cycle-through-videos/#findComment-1185180 Share on other sites More sharing options...
JohnOP Posted March 9, 2011 Author Share Posted March 9, 2011 Ah i see, my videos are both about 2 minutes long, and they both show the whole video on there own page but what i want for the homepage is lets say show the first 15 secs of video one then it to switch to video 2 to show 15 secs of that then the same again, so there not on the home page watching for minutes, any sort of code i could stat with here then i can do the rest, i would appreciate it? I could do the whole array part and pick a random video, im just unsure on how to cut it after so many seconds. Quote Link to comment https://forums.phpfreaks.com/topic/230111-cycle-through-videos/#findComment-1185189 Share on other sites More sharing options...
MatthewJ Posted March 10, 2011 Share Posted March 10, 2011 Hmm, maybe put in a $_SESSION var a flag that video 1 has already been viewed... refresh the page, check for the flag, and display the appropriate vid based on the flag? Quote Link to comment https://forums.phpfreaks.com/topic/230111-cycle-through-videos/#findComment-1185743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.