6

After create a flowplayer instance like this:

$f("player", "flowplayer.swf", "my-video.flv");

When remove the container element directly, $("#player").remove()(using jQuery),

I found the $f("player") still there. How to remove the instance really?

tshepang
  • 12,111
  • 21
  • 91
  • 136
dencey
  • 1,041
  • 17
  • 25

2 Answers2

2

On BestKicker, we use $f().unload().

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Hugues
  • 76
  • 1
0

I basically stored the contents of the DOM element that holds the player element in jQuery data on DOM ready:

$('.video-holder').each(function(i,el){
    $(el).data('init-state', $(el).html());
});

... then reset the contents (thereby detaching the Flowplayer instance) by calling the stored data back into the holder element's HTML to effectively 'reset' it:

$('.video-holder').each(function(i,el){
    $(el).html($(el).data('init-state'));
});

I've only tried this using Flowplayer manual setup, don't think it'd work on auto. Also it probably wouldn't be great performance-wise if you were doing it over and over as the original Flowplayer instance is still loaded in memory, just detached, but was the best solution I could come up with.

Storsey
  • 301
  • 1
  • 3
  • 14