webpage intro video overlay and how often it plays [closed] - html

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am designing a webpage with an overlay intro video. Essentially the moment you enter the webpage an intro video will play. It works and did what I wanted it to do. WHAT I DON'T WANT IT TO DO is play every time I go into this page. What I want to do is:
Have the video play the moment you enter the page (PAGE A).
Then lets say you go to page B...
After that you return to page A and the video doesn't play again until after a certain period of time (lets say 12 hours).
We did figure out a way to do this but we lost the code, so we know its possible.
Anyway you guys can help me out here?

I would look into localStorage or sessionStorage. Either of those can be used to store information in-browser - for example, whether or not the user has seen the video before. On load, check localStorage for videoPlayed (or whatever you decide to call the variable) and use that to determine whether or not to show the video.
The main difference between the two is that localStorage never expires, while sessionStorage does once the page/browser is closed.

Related

Can a website tell a user's browser to store the entire page locally? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
Can a (single-page) website tell a user's browser to store an entire page locally?
For context: I'm hosting a website on a server that charges according to bandwidth. The contents of the site don't change much, so I'm wondering if the user's browser can store the webpage rather than sending repeat requests for the web page!
I've looked into browser-native cacheing, but that appears to be for further requests triggered after the page's scripts load!
This is usually achieved thanks to PWA and Service workers: https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers
Actually it's the only way of doing that I know, it can be a bit tricky but it's quite interesting once you understand everything that you can do with it.

Get video from youtube or file system [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Just wondering if there is any benefit to loading a video from youtube or any other service vs. loading video from a folder in my site's file structure.
YouTube's CDN probably delivers video to the visitor faster than your server.
YouTube's bandwidth costs you less money than your bandwidth.
YouTube's code for generating multiple video formats, automatic quality switching and subtitling is probably better than your code for doing the same.
Just to play devil's advocate to Quentin's answer, if the original YouTube video gets taken down, you'll have a dead link on your page. If you host it yourself, you won't lose it when the original creator takes it down (unless you control the account that posted it, in which case this argument is null)

Open link in new tab without loading it [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Is it possible to open links in a new tab inside Google Chrome without loading them? And instead, that it would wait for you to manually go to the tab to start loading ? (same philosophy as what Firefox, I suppose. Firefox does this when you open it and it starts where you left off, loading only the first-tab/last-loaded-tab)
Please let me know if there is a way to do that in Google Chrome, either by editing options or by the use of an extension you know off, that would be helpful.
Yes, this should be sort-of possible, but it's ugly and you still have to load something.
Basically, you need a bare-bones page that has JavaScript to detect whether or not the page has focus. You can use the code samples here to determine that: Is there a way to detect if a browser window is not currently active?
Once the page has focus, you can redirect to the actual page. This is messy. Don't do it, unless you have a really good reason. Your users will hate you for it.

HTML5 Game code with Canvas [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to create a tile based 'whack a mole' game in HTML 5. Also at every instance a new mole appears at a given tile an audio prompt needs to given indicating where the mole is(this is so that visually impaired individuals can also play it ). Additionally on hover over each tile its location needs to be said aloud (eg.(3,4)). Now the problem is I am not sure how do I start programming this in HTML5. Please can someone help me.
you may want to try panda.js it is a html5 game engine for mobile and desktop
and it has video tutorial
the showcase itself had whack a mole like game
http://www.pandajs.net/showcase/
(full disclosure: I've used pandajs myself)
Start with the basics in javascript. You'll need this to do anything in HTML5 canvas:
http://www.w3schools.com/js/default.asp
Then proceed learning about HTML5 canvas:
http://www.html5canvastutorials.com/tutorials/html5-canvas-tutorials-introduction/

Spotify Play button [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Just looking for some clarification with the new play button. I notice that when you hit play on the widget, it plays the song in the actual spotify app. Does that mean you need spotify to use the widget? What happens if you hit play and you don't have spotify? Do you have plans to make the widget independent of the app?
The Play Button works in a very similar way to Spotify's Facebook integration:
The tracks are played in the Spotify client.
If the Spotify client isn't running, it'll be launched.
If it isn't installed, the user will be led through a streamlined install process.
At the moment, this is required simply because without it we'd have to write a Spotify client in JavaScript, which is 1) hard and 2) served in plain text, which isn't really something we want to do! :-)