[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linterna-magica-commit] [407] Adds support for videolectures.net.
From: |
Ivaylo Valkov |
Subject: |
[linterna-magica-commit] [407] Adds support for videolectures.net. |
Date: |
Sun, 14 Jul 2013 15:18:03 +0000 |
Revision: 407
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=407
Author: valkov
Date: 2013-07-14 15:18:03 +0000 (Sun, 14 Jul 2013)
Log Message:
-----------
Adds support for videolectures.net. Fixes bugs #38400. Will not work in Firefox
since there are problems with the handling of the mms:// scheme in which the
URLs are.
Ticket Links:
------------
http://savannah.gnu.org/bugs/?38400
Modified Paths:
--------------
trunk/src/lm_create_video_object.js
trunk/src/lm_extract_dom_objects.js
Added Paths:
-----------
trunk/src/lm_site_videolecturesnet.js
Modified: trunk/src/lm_create_video_object.js
===================================================================
--- trunk/src/lm_create_video_object.js 2013-07-14 10:18:04 UTC (rev 406)
+++ trunk/src/lm_create_video_object.js 2013-07-14 15:18:03 UTC (rev 407)
@@ -136,7 +136,7 @@
// - The UA it sends is different from the browser, Vimeo does
// not load.
// With video/flv totemCone plugin will load.
- if (/mp4|m4v|quicktime/i)
+ if (/mp4|m4v|quicktime/i.test(object_data.mime))
{
var mp4 = navigator.mimeTypes["video/mp4"];
if (mp4 && mp4.enabledPlugin && mp4.enabledPlugin.name &&
Modified: trunk/src/lm_extract_dom_objects.js
===================================================================
--- trunk/src/lm_extract_dom_objects.js 2013-07-14 10:18:04 UTC (rev 406)
+++ trunk/src/lm_extract_dom_objects.js 2013-07-14 15:18:03 UTC (rev 407)
@@ -101,6 +101,7 @@
extracted_data = val;
}
+ object_data.mime = extracted_data.mime;
object_data.remote_site_link = extracted_data.remote_site_link;
object_data.link = extracted_data.link;
object_data.video_id = extracted_data.video_id;
Added: trunk/src/lm_site_videolecturesnet.js
===================================================================
--- trunk/src/lm_site_videolecturesnet.js (rev 0)
+++ trunk/src/lm_site_videolecturesnet.js 2013-07-14 15:18:03 UTC (rev
407)
@@ -0,0 +1,73 @@
+// @licstart The following is the entire license notice for the
+// JavaScript code in this page (or file).
+//
+// This file is part of Linterna Mágica
+//
+// Copyright (C) 2013 Ivaylo Valkov <address@hidden>
+//
+// The JavaScript code in this page (or file) is free software: you
+// can redistribute it and/or modify it under the terms of the GNU
+// General Public License (GNU GPL) as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option)
+// any later version. The code is distributed WITHOUT ANY WARRANTY
+// without even the implied warranty of MERCHANTABILITY or FITNESS
+// FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
+//
+// As additional permission under GNU GPL version 3 section 7, you
+// may distribute non-source (e.g., minimized or compacted) forms of
+// that code without the copy of the GNU GPL normally required by
+// section 4, provided you include this license notice and a URL
+// through which recipients can access the Corresponding Source.
+//
+// @licend The above is the entire license notice for the JavaScript
+// code in this page (or file).
+//
+// @source http://linterna-magica.nongnu.org
+
+// END OF LICENSE HEADER
+LinternaMagica.prototype.sites["videolectures.net"] = new Object();
+
+// Reference
+LinternaMagica.prototype.sites["www.videolectures.net"] = "videolectures.net";
+
+LinternaMagica.prototype.sites["videolectures.net"].skip_link_extraction =
+function()
+{
+ var see_also = document.getElementById("vl_seealso");
+
+ if (!see_also)
+ {
+ return null;
+ }
+
+ var ps = see_also.getElementsByTagName("p");
+
+ if (!ps)
+ {
+ return null;
+ }
+
+ var p = ps[0];
+ var link = p.getElementsByTagName("a");
+
+ if (!link)
+ {
+ return null;
+ }
+
+ link = link[0];
+
+ var extracted_data = new Object();
+ extracted_data.link = link.getAttribute("href");
+ // Breaks the web controls. Works fine in Totem without this.
+ // extracted_data.mime = "video/x-ms-wmv";
+
+ return extracted_data;
+
+}
+
+LinternaMagica.prototype.sites["videolectures.net"].do_not_force_iframe_detection
=
+function()
+{
+ return false;
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [linterna-magica-commit] [407] Adds support for videolectures.net.,
Ivaylo Valkov <=