I would like to add a video (autoplay) before the visitor go into my wp blog (maybe just the homepage, not every post), how could this be possible? I think javascript maybe the best choose?
Could you give your solution (no matter js or not) in detail?
EDIT:
After a while, I think this should work for me, but the fact is not, why?
document.write('<style type="text/css">n
#wrapper, #header, #footer{ display:none;}n
</style>n
<video id="loadDiv" preload="auto" data-setup="{}" loop="loop"
webkit-playsinline="" style="position: absolute; width: 100%" autoplay=""
src="http://srcofvideo">
</video>'
);
window.onload = function() {
setTimeout(function () {
document.getElementById("loadDiv").style.display = "none";
document.getElementById("wrapper").style.display = "block";
document.getElementById("header").style.display = "block";
document.getElementById("footer").style.display = "block";
},10000)}
My suggestion :
Technical details :
*Use and adapt this code for making your video splash template and save it as “splash.php” and put this in your WordPress theme folder – More background info can be found here: http://codex.wordpress.org/Page_Templates –>*
Use this CSS code for making your spash video full screen and save it as “css/video.css” in your CSS directory –>
As an example see my own WordPress site with video splash page using the code above :
http://www.pe-vermeersch.com
This solution looks to redirect the user after login to a page, or a post, or where ever if the transient value is set. This transient is set to remember the user for 5 hours. After the 5 hours WordPress deletes the transient.
If a user logs in and there is a not a transient representing them then the function creates a transient, remembers it for 5 hours, and then redirects the user to the desired page.
get_transient() should return false if there is no transient or if there is a problem, so if the script fails the user will be redirected to your video page.
You should include a link back to your homepage on the page that the user is redirected to, and embedd the video on the page that the function redirects to.
Show a popup link on the home page.
first you need thickbox and jquery on your front end.
Put this in your functions.php:
Then put this in your footer.php preferable after
<?php wp_footer() ?>
:You can put whatever you want to display in the my-content-id division. Right now it shows one of my youtube videos. But you could put a js player here or a youtube or vimeo video. A youtube or vimeoembedd would be much more simple.