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

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

[linterna-magica-commit] [356] Merging r354 and r355 from trunk to fix Y


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [356] Merging r354 and r355 from trunk to fix YouTube.
Date: Sat, 22 Dec 2012 12:27:46 +0000

Revision: 356
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=356
Author:   valkov
Date:     2012-12-22 12:27:45 +0000 (Sat, 22 Dec 2012)
Log Message:
-----------
Merging r354 and r355 from trunk to fix YouTube.

Revision Links:
--------------
    http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=354
    http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=355

Modified Paths:
--------------
    branches/0.0.12/src/lm_site_youtube.js

Property Changed:
----------------
    branches/0.0.12/


Property changes on: branches/0.0.12
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/0.0.9:94
/branches/task-11216:102-156
/trunk:287,292,314,318,323,327,338,340,342
   + /branches/0.0.9:94
/branches/task-11216:102-156
/trunk:287,292,314,318,323,327,338,340,342,354-355

Modified: branches/0.0.12/src/lm_site_youtube.js
===================================================================
--- branches/0.0.12/src/lm_site_youtube.js      2012-12-22 12:24:49 UTC (rev 
355)
+++ branches/0.0.12/src/lm_site_youtube.js      2012-12-22 12:27:45 UTC (rev 
356)
@@ -196,7 +196,7 @@
 
     // Fancy flash upgrade message. The element with id flash-upgrade
     // might be obsolete now.
-    var watch_player = document.getElementById("watch-player");
+    var watch_player = document.getElementById("watch7-player");
     var fancy_alert = null;
 
     if(watch_player && watch_player.hasAttribute("class") &&
@@ -212,12 +212,12 @@
     }
     
 
-    // With default timeout 500mS this will be 6 sec. Stop checking and 
insert.    
+    // With default timeout 2000mS this will be 10 sec. Stop checking and 
insert.    
     // Might be flashblock
-    if (document.getElementById("flash-upgrade") ||
+    if (document.getElementById("movie_player") ||
        document.getElementById("movie_player-html5") ||
        fancy_alert ||
-       this.youtube_flash_upgrade_counter >= 12 )
+       this.youtube_flash_upgrade_counter >= 5 )
     {
        clearInterval(this.youtube_flash_upgrade_timeout);
 
@@ -229,7 +229,7 @@
        this.log("LinternaMagica.detect_youtube_flash_upgrade:\n"+
                 "Creating video object.",2);
 
-       this.create_video_object(object_data);
+       setTimeout(this.create_video_object(object_data), 1000);
     }
 }
 
@@ -334,6 +334,14 @@
     return false;
 }
 
+LinternaMagica.prototype.sites["youtube.com"].skip_video_id_extraction = 
function()
+{
+    this.log("LinternaMagica.sites.skip_video_id_extraction:\n"+
+            "Skipping video_id extraction in YouTube.",4);
+    return false;
+}
+
+
 // Extracts data for the flash object in youtube from a script
 LinternaMagica.prototype.sites["youtube.com"].extract_object_from_script =
 function()
@@ -472,7 +480,7 @@
        this.youtube_flash_upgrade_timeout = setInterval(
            function() {
                self.detect_youtube_flash_upgrade.apply(self,[data]);
-           }, 500);
+           }, 2000);
     }
     
     return false;
@@ -481,6 +489,27 @@
 LinternaMagica.prototype.sites["youtube.com"].css_fixes =
 function(object_data)
 {
+
+    // Sometimes when flash is installed the flash video object does
+    // not have (at all or the right one) linterna_magica_id. Usually
+    // the other objects if any are useless. This renders both LM and
+    // the flash interface. The code bellow tries to avoid it. Reason
+    // *unknown*.
+
+    this.log("LinternaMagica.youtube.css_fixes:\n "+
+            "Harvesting (possible) lost flash video object with "+
+            "linterna_magica_id "+ object_data.linterna_magica_id);
+
+    var movie_player = document.getElementById('movie_player');
+    if (movie_player) {
+       movie_player.linterna_magica_id = object_data.linterna_magica_id;
+    }
+
+    if (this.priority.self > this.priority.plugin)
+    {
+       this.hide_flash_video_object(object_data.linterna_magica_id);
+    }
+
     if (document.getElementById("playnav-playview"))
     {
        // In channels/user pages in YouTube the web controlls are




reply via email to

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