linterna-magica-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linterna-magica-commit] [303] Experimental fix for bugs #36888.


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [303] Experimental fix for bugs #36888.
Date: Tue, 14 Aug 2012 13:15:46 +0000

Revision: 303
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=303
Author:   valkov
Date:     2012-08-14 13:15:46 +0000 (Tue, 14 Aug 2012)
Log Message:
-----------
Experimental fix for bugs #36888.

When the flash video object is forced to the backaground, it is
cloned, removed and the clone reinserted with fake type
(x-fake/x-flash-stoppped) to ensure that the flash plugin stops
playing on the background.

When the flash video object is brought to the foreground it is cloned,
removed and the clone reinserted with valid type
(application/x-shockwave-flash), so a flash plugin can handle it.

When the Linterna M?\195?\161gica video object is sent to the background, its
playback is stopped.

#future_release_0.0.13

Ticket Links:
------------
    http://savannah.gnu.org/bugs/?36888

Modified Paths:
--------------
    trunk/src/lm_video_and_flash_objects_helper_functions.js

Modified: trunk/src/lm_video_and_flash_objects_helper_functions.js
===================================================================
--- trunk/src/lm_video_and_flash_objects_helper_functions.js    2012-08-04 
07:47:39 UTC (rev 302)
+++ trunk/src/lm_video_and_flash_objects_helper_functions.js    2012-08-14 
13:15:46 UTC (rev 303)
@@ -147,6 +147,9 @@
        return null;
     }
 
+    var self = this;
+    this.player.stop.apply(self, [linterna_magica_id]);
+
     lm.style.setProperty("display", "none", "important");
 }
 
@@ -162,6 +165,11 @@
        return null;
     }
 
+
+    // See https://savannah.nongnu.org/bugs/?36888
+    flash_object = 
+       this.force_flash_video_object_type(flash_object,
+                                    "application/x-shockwave-flash");
     flash_object.style.removeProperty("display");
 
     return flash_object;
@@ -179,11 +187,54 @@
        return null;
     }
 
+    // Force the playback to stop. Setting the object on the
+    // background and changing its type alone does not work. 
+    // See https://savannah.nongnu.org/bugs/?36888
+    flash_object = this.force_flash_video_object_type(flash_object,
+                                               "x-fake/x-flash-stopped");
+
     flash_object.style.setProperty("display", "none", "important");
 
     return flash_object;
 }
 
+// Force the flash object to another type. Used when hiding the flash
+// player to stop its playback so there is no dual playback as
+// described in bug #36888.
+// See https://savannah.nongnu.org/bugs/?36888
+LinternaMagica.prototype.force_flash_video_object_type =
+function(flash_object, type)
+{
+    if (!flash_object || !type)
+    {
+       return null;
+    }
+
+    var sibling = flash_object.nextSibling ? 
+       flash_object.nextSibling : null;
+
+    var parent = flash_object.parentNode;
+
+    var clone = flash_object.cloneNode(true);
+    clone.linterna_magica_id = flash_object.linterna_magica_id;
+    
+    flash_object.parentNode.removeChild(flash_object);
+
+    flash_object = clone;  
+    flash_object.setAttribute("type", type);
+    
+    if (sibling)
+    {
+       parent.insertBefore(flash_object, sibling);
+    }
+    else
+    {
+       parent.appendChild(flash_object);
+    }
+
+    return flash_object;
+}
+
 // Check all video objects to find if one is started.
 LinternaMagica.prototype.find_started_clip = function()
 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]