www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19

Thread: Limit Button to 6 clicks per hour

  1. #16
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,355
    Quote Originally Posted by dardisintel View Post
    Sorry, I'm looking for one of these local storage scripts you were talking about?
    See: http://diveintohtml5.info/storage.html
    or: http://www.w3schools.com/html/html5_webstorage.asp
    or: http://coding.smashingmagazine.com/2...how-to-use-it/

    Alternatively, you could use a cookie script. Google that or see references above.

  2. #17
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,213
    If you are using a video player to play back then you must have a video stream element to it which means that you have no need for a script to stop the user from forwarding.

    For complete control including page refreshes, you should look at sessions, store information regarding the number of clicks to fast forward in a session variable and have that value written in to the button clicks left.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  3. #18
    Join Date
    Mar 2013
    Location
    Great Falls, MT
    Posts
    24
    You I'm talking about skipping the song entirely NOT skipping ahead in the song right?

    Quote Originally Posted by \\.\ View Post
    If you are using a video player to play back then you must have a video stream element to it which means that you have no need for a script to stop the user from forwarding.

    For complete control including page refreshes, you should look at sessions, store information regarding the number of clicks to fast forward in a session variable and have that value written in to the button clicks left.

  4. #19
    Join Date
    Mar 2013
    Location
    Great Falls, MT
    Posts
    24

    Solved

    For anyone looking to limit the number of allowed skips using jPlayer.

    You can access last_clicks, max_clicks, and time_for_max_clicks inside your main .js file.

    Code:
    (function($) {
        $.fn.ttwMusicPlayer = function(playlist, userOptions) {
            var $self = this, defaultOptions, options, cssSelector, appMgr, playlistMgr, interfaceMgr, ratingsMgr, playlist,
                    layout, ratings, myPlaylist, current;
    		var last_clicks = [];
    		var max_clicks = 6;
    		var time_for_max_clicks = 3600; //in seconds
            cssSelector = 
    {

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles