Domanda

You would think this would be easy/obvious, however, I've been struggling with it for a long while with little success.

I need to use the HTML5 (with Flash fallback) Flowplayer for showing videos within online surveys. I want the user to be able to hit PLAY, and to be able to adjust volume BUT THAT IS ALL - no seeking, no pausing, no stopping. This needs to work for as many platforms/OS/browsers as possible. I have had some success "disabling" the player after the user hits play, which prevents any user interaction however, it also prevents access to the volume controls.

Thus far, I have used:

   $(".flowplayer:first").bind("resume", function (e, api) {
      //shut off controls, **problem is that it also shuts off volume controls!**
      flowplayer().disable(true); //shut-off the controls
   });

//Ready Handler - **prevents access to timeline for seeking before the user hits play**
       $(".flowplayer:first").bind("ready", function (e, api) { 
           flowplayer.conf.keyboard = false;
           $(".fp-timeline").unbind("mousedown touchstart");
           $(".flowplayer").removeClass("is-touch");
       }

Before answering, please ensure you are looking at Flowplayer, and not "Flowplayer Flash", for which there does seem to be an easy solution

È stato utile?

Soluzione

It seems you can attach function to events, like pause and return false to prevent anything from happening. Would that work? I can't really test it.

$(".flowplayer:first").bind("pause", function(e, api) {
    return false;
});

http://flowplayer.org/docs/api.html#section_jquery

Or maybe something like:

$(".flowplayer:first").bind("play", function(e, api) {
    $(".fp-play, .fp-timeline").unbind("click");
    // Other controls and events...
});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top