Reputation: 4250
I have a div element that shows up after 20 second of video play.If you will play the video after 20 second of play a div will shows up. Now I want to set cookie so that if the div have been shown once ,it keeps on showing unless the user clear the cache (cookie logic).
This is what I have tried so far -
How can this be achieved?
Thanks In Advance .
Upvotes: 1
Views: 49
Reputation: 2267
You could set the cookie in your onPlayProgress
function, and read the same cookie handle in your click play listener:
// set
document.cookie='20secSet=true';
// get
var cookieVal = document.cookie
.split(',')
.indexOf('20secSet=true');
Here's an example using your code.
Upvotes: 0