You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

onStop broken in some browsers Created May 10, 2010

This thread is solved

Views: 3957     Replies: 31     Last reply May 30, 2011  
You must login first before you can use this feature

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

onStop broken in some browsers

Posted: May 10, 2010

onStop has become a clip method, but it does not work in some browsers. So far I've tested Firefox, Opera (broken, starts playing again) - WebKit browsers seem ok.

To reproduce:

Flowplayer forum example

HTML setup for the player

<!-- include latest Flowplayer javascript file -->
<script language="javascript" src="path/to/flowplayer-3.2.6.js"></script>

<!-- player container with optional splash image -->
<a href="path/to/video_file" id="playerContainer">
	<img src="path/to/splash_image" />
</a>


JavaScript coding

Following script will install Flowplayer into our player container


<script language="javascript">
// our custom configuration is given in third argument
flowplayer("playerContainer", "path/tohttp://releases.flowplayer.org/swf/flowplayer-3.2.7.swf",{
clip: {
  onStop: function () {
    this.unload();
  }
},
plugins: {
  controls: {stop: true}
}
});
</script>


See also this post.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» onStop broken in some browsers

Posted: May 10, 2010

Reply to: onStop broken in some browsers, from blacktrash
Addendum:

Interestingly enough onStop still works as a player event as well (in WebKit browsers). So, what is it now? A clip event or a player event? Or a browser specific event? ;-)

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » onStop broken in some browsers

Posted: May 10, 2010

Reply to: » onStop broken in some browsers, from blacktrash
P.S. In Firefox the player unloads onStop when in fullscreen ... whereas WebKit browsers do not crash anymore in that situation by avoiding to unload (not necessarily a bug fix) ... win some, lose some.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» onStop broken in some browsers

Posted: Jun 10, 2010

Reply to: onStop broken in some browsers, from blacktrash
Still happening with 3.2.2:

  1. not in fullscreen
    1. In Firefox or Opera click stop, and the clip replays
    2. WebKit, IE 8: player unloads

  2. fullscreen

    1. Firefox, Opera: fullscreen exit + player unload
    2. WebKit, IE 8: no fullscreen exit (at least no WebKit Crash)

1.1. prevents me from upgrading :-(

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » onStop broken in some browsers

Posted: Jun 21, 2010

Reply to: » onStop broken in some browsers, from blacktrash
Finally found a very ugly workaround:

Flowplayer forum example

HTML setup for the player

<!-- include latest Flowplayer javascript file -->
<script language="javascript" src="path/to/flowplayer-3.2.6.js"></script>

<!-- player container with optional splash image -->
<a href="path/to/video_file" id="playerContainer">
	<img src="path/to/splash_image" />
</a>


JavaScript coding

Following script will install Flowplayer into our player container


<script language="javascript">
// our custom configuration is given in third argument
flowplayer("playerContainer", "path/tohttp://releases.flowplayer.org/swf/flowplayer-3.2.7.swf",{
clip: {
  onStop: function () {
    var self = this;
    // timeout needed for Firefox, Opera (Gecko?)
    setTimeout(function () {
      self.unload();
    }, 10);
  }
},
plugins: {
  controls: {stop: true}
}
});
</script>


Needless to say, I still consider this a regression over flowplayer 3.1. A pity, as demandloading/unloading the player is a unique advantage of flowplayer over the longtail player.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: onStop broken in some browsers, from blacktrash
Still broken in 3.2.3. Oh, well.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: » onStop broken in some browsers, from blacktrash
Hey,

Thanks for tracking that down. So the issue is when you're doing :

onStop: function () {
    this.unload();
  }

Am I correct ?

Thanks,
Thomas

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: » » onStop broken in some browsers, from blaaaaaaah
Yes, just try the demo in the first post in Firefox.

At least my setTimeout workaround still works around ;-)

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: » » » onStop broken in some browsers, from blacktrash
Yep, this is interesting :)
I'll add that to the bug tracker and fix that.

Cheers,
Thomas

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: » » » » onStop broken in some browsers, from blaaaaaaah
Be careful not to regress to WebKit browsers crashing when unloading onStop in fullscreen. See also this thread:

http://flowplayer.org/forum/8/11666

Started in December 2008 (!)

It would be nice if WebKit browser also could unload onStop in fullscreen. I disabled this via JavaScript pre 3.2, now it just doesn't work (but at least no crash).

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: » » » » » onStop broken in some browsers, from blacktrash
Yep I did this workaround.
I'll take a look again to see if it can be fixed properly

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » » » onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: » » » » » » onStop broken in some browsers, from blaaaaaaah
Thanks for looking into this!

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » » onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: » » » » » » » onStop broken in some browsers, from blacktrash
You're welcome :)
BTW, did the unload-onStop-when-fullscreen did ever work in webkit browsers ?

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » » » » » onStop broken in some browsers

Posted: Aug 17, 2010

Reply to: » » » » » » » » onStop broken in some browsers, from blaaaaaaah
Nope. Unless you call crashing working ;-)

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » » » » onStop broken in some browsers

Posted: Aug 18, 2010

Reply to: » » » » » » » » » onStop broken in some browsers, from blacktrash
:)
OK, so it's not a regression .. Will see what I can do.

Cheers

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» onStop broken in some browsers

Posted: Aug 28, 2010

Reply to: onStop broken in some browsers, from blacktrash
Still broken in 3.2.4.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » onStop broken in some browsers

Posted: Aug 29, 2010

Reply to: » onStop broken in some browsers, from blacktrash
Yep, didn't had time to work on this, sorry :)

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » onStop broken in some browsers

Posted: Aug 29, 2010

Reply to: » » onStop broken in some browsers, from blaaaaaaah
No problem. Just book-keeping or bug-tracking ;-)

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» onStop broken in some browsers

Posted: Oct 1, 2010

Reply to: onStop broken in some browsers, from blacktrash
And again a bump for 3.2.5 ;-)

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » onStop broken in some browsers

Posted: May 26, 2011

Reply to: » onStop broken in some browsers, from blacktrash
I think i managed to solve some problems here. Please try with these:

http://flowplayer-releases.s3.amazonaws.com/js/flowplayer-src.js

http://flowplayer-releases.s3.amazonaws.com/info/dist.html

Unloads properly without a setTimeout on Chrome, Firefox, Safari and Opera. Unloads from fullscreen on Firefox, Safari and Opera.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » onStop broken in some browsers

Posted: May 28, 2011

Reply to: » » onStop broken in some browsers, from Anssi
There's a problem with flowplayer-src.js, line 546:

ReferenceError: Can't find variable: flashembed

With the latest swf files and flowplayer-3.2.6.min.js the behaviour stays the same. For WebKit that's expected I guess, because the js prevents unloading onFullscreen. Firefox still restarts playback instead of unloading.

It also should be documented that $f().unload does nothing when the player container is empty.

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » » onStop broken in some browsers

Posted: May 28, 2011

Reply to: » » » onStop broken in some browsers, from blacktrash
You need to include also flashembed with this version of flowplayer-src.js. You can use this:

http://flowplayer-releases.s3.amazonaws.com/js/jquery.tools.min.js

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » onStop broken in some browsers

Posted: May 28, 2011

Reply to: » » » » onStop broken in some browsers, from Anssi
I get a 403 forbidden Error for that url.

Does that mean jQuery Tools, or jQuery, will be mandatory as well? Or only flashembed.js?

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » » » » onStop broken in some browsers

Posted: May 28, 2011

Reply to: » » » » » onStop broken in some browsers, from blacktrash
Oops. Now the permissions are fixed.

flashembed.js will be integrated to that flowplayer.js before it gets released.

No new additional dependencies will be added. Use that tools.js now just to test this - it only contains flashembed (no other tools in it).

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » » » onStop broken in some browsers

Posted: May 28, 2011

Reply to: » » » » » » onStop broken in some browsers, from Anssi
http://flowplayer.blacktrash.org/dev/unload.html

Nevermind the text (it's the current release behaviour), go to 2nd example:

Firefox works again - no replay onStop, but indeed unload.

But Safari crashes again when stopping in fullscreen with:


clip: {
  onStop: function () {
    this.unload();
  }
}

Regression. Better leave in the condition in flowplayer.js for WebKit browsers which precludes unloading from fullscreen mode. And document it ;-)

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » » » » » » onStop broken in some browsers

Posted: May 29, 2011

Reply to: » » » » » » » onStop broken in some browsers, from blacktrash
Ok. I am testing this on a Mac and for me unloading from fullscreen works OK and does not crash. But i guess i need to leave the webkit specific condition in place :-)

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » » » » » onStop broken in some browsers

Posted: May 29, 2011

Reply to: » » » » » » » » onStop broken in some browsers, from Anssi
What is very strange: Google Chrome (also WebKit engine) does not crash!

You probably also have a newer version of Safari, because I'm still on MacOS 10.5.8 (Leopard). Safari Version 5.0.5 (5533.21.1) here. navigator.userAgent:


"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1"

I don't think I have any special configuration settings on in Safari, but will investigate some more.

I've also sent the report to Apple, but that won't help much I guess.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » » » » » » onStop broken in some browsers

Posted: May 29, 2011

Reply to: » » » » » » » » » onStop broken in some browsers, from blacktrash
Crashes with default settings and Flash debugger uninstalled, developer tools deactivated.

What's the 10.6 version of Safari? Perhaps narrow down the condition as far as possible?

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » » » » » » » » » onStop broken in some browsers

Posted: May 30, 2011

Reply to: » » » » » » » » » » onStop broken in some browsers, from blacktrash
I have Safari 5.0.5 on my Mac.

Also tested on Windows 7 and Safari 5.0.5. Unloading works without problems, both from fullsreen and from "normal mode".

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » » » » » » » » onStop broken in some browsers

Posted: May 30, 2011

Reply to: » » » » » » » » » » » onStop broken in some browsers, from Anssi
Just to be sure: you have tested with the 2nd example at:

http://flowplayer.blacktrash.org/dev/unload.html

click stop, while in fullscreen.

The first example does not unload at all, because the player container is empty.

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » » » » » » » » » » » onStop broken in some browsers

Posted: May 30, 2011

Reply to: » » » » » » » » » » » » onStop broken in some browsers, from blacktrash
yes i have been testing with the 2nd player. And it unloads back to the image (player disappears) when hitting stop in fullscreen.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » » » » » » » » » » » » onStop broken in some browsers

Posted: May 30, 2011

Reply to: » » » » » » » » » » » » » onStop broken in some browsers, from Anssi
Must be a problem on 10.5.8 then. I can reproduce the crash with Safari default settings. Just did it again. Annoying.

Well, as long as noone else complains, I can work around it in my setups by readding the condition.