[cvs-annodex] commit (/annodex):
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
andre
nobody at lists.annodex.net
Sun Feb 27 15:38:49 EST 2005
Update of /annodex (new revision 975)
Modified files:
AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
Log Message:
AnnodexFirefoxExtension:
* Attempt to make video resizing on Mac OS X suck less (why is resizing plugin areas in Mozilla such a PITA on all platforms?)
Modified: AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js
===================================================================
--- AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js 2005-02-26 22:47:32 UTC (rev 974)
+++ AnnodexFirefoxExtension/trunk/chrome/afeview/content/afeview.js 2005-02-27 04:38:48 UTC (rev 975)
@@ -61,6 +61,9 @@
var PreviouslyActive = undefined;
var PreviousHRef = undefined;
+var PendingVideoViewWidth;
+var PendingVideoViewHeight;
+
function AFEViewInterfaceLoaded ()
{
// Use the information after the search portion of the URL (the bit after
@@ -250,6 +253,21 @@
PreviouslyActive = active;
}
+ // If we're running on Mac OS X, handle video resizing here: see the comment
+ // in updateVideoViewSize() for why ...
+ if ( navigator.platform == "MacPPC"
+ && PendingVideoViewWidth != undefined
+ && PendingVideoViewHeight != undefined)
+ {
+ videoView.setAttribute("width", PendingVideoViewWidth);
+ videoView.setAttribute("height", PendingVideoViewHeight);
+
+ dump("Resizing view ...\n");
+
+ PendingVideoViewWidth = undefined;
+ PendingVideoViewHeight = undefined;
+ }
+
// Update media engine's HRef parameter, so that we can go to a new
// hyperlink if we click on the movie view itself (if the media engine
// supports this capability, anyway)
@@ -918,8 +936,21 @@
var width = videoViewBox.boxObject.width;
var height = videoViewBox.boxObject.height;
- videoView.setAttribute("width", width);
- videoView.setAttribute("height", height);
+ // Mozilla on Mac OS X seems to have problems many video resizing commands
+ // are sent in a short space of time, so what we do there is store the
+ // new width/height values in a global variable, and the updateInterface()
+ // function will pick it whenever it's run (every half a second). It's
+ // still not as stable as I'd like to it to be, but it is much, much better!
+ if (navigator.platform == "MacPPC")
+ {
+ PendingVideoViewWidth = width;
+ PendingVideoViewHeight = height;
+ }
+ else
+ {
+ videoView.setAttribute("width", width);
+ videoView.setAttribute("height", height);
+ }
// videoViewBox.setAttribute("maxwidth", width);
// videoViewBox.setAttribute("maxheight", height);
--
andre
More information about the cvs-annodex
mailing list