[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linterna-magica-commit] [165] Fixes for tasks #11211.
From: |
Ivaylo Valkov |
Subject: |
[linterna-magica-commit] [165] Fixes for tasks #11211. |
Date: |
Thu, 28 Jul 2011 14:10:49 +0000 |
Revision: 165
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=165
Author: valkov
Date: 2011-07-28 14:10:48 +0000 (Thu, 28 Jul 2011)
Log Message:
-----------
Fixes for tasks #11211. Added support for live shows.
Ticket Links:
------------
http://savannah.gnu.org/task/?11211
Modified Paths:
--------------
trunk/WEBSITES
trunk/src/lm_forbidden_objects.js
trunk/src/lm_site_livestreamcom.js
Modified: trunk/WEBSITES
===================================================================
--- trunk/WEBSITES 2011-07-28 12:37:53 UTC (rev 164)
+++ trunk/WEBSITES 2011-07-28 14:10:48 UTC (rev 165)
@@ -49,6 +49,7 @@
http://video.xfree.hu/
http://www.clipjunkie.com
http://yourlisten.com
+http://livestream.com
Bulgarian:
http://vbox7.com
Modified: trunk/src/lm_forbidden_objects.js
===================================================================
--- trunk/src/lm_forbidden_objects.js 2011-07-28 12:37:53 UTC (rev 164)
+++ trunk/src/lm_forbidden_objects.js 2011-07-28 14:10:48 UTC (rev 165)
@@ -36,7 +36,9 @@
// Facebook iframes in blip.tv
"^f[0-9]+[a-z]+",
// Blip.tv objects
- "easyXDM_DISQUS_net_default[0-9]+_provider"];
+ "easyXDM_DISQUS_net_default[0-9]+_provider",
+ // livestream.com
+ "twitterIframe"];
// Skip objects that has id matching a regex (see above array)
LinternaMagica.prototype.skip_object_if_id = function(id_string)
Modified: trunk/src/lm_site_livestreamcom.js
===================================================================
--- trunk/src/lm_site_livestreamcom.js 2011-07-28 12:37:53 UTC (rev 164)
+++ trunk/src/lm_site_livestreamcom.js 2011-07-28 14:10:48 UTC (rev 165)
@@ -31,6 +31,22 @@
// Reference
LinternaMagica.prototype.sites["www.livestream.com"] = "livestream.com";
+LinternaMagica.prototype.sites["livestream.com"].set_video_id_regex =
+function()
+{
+ var result = new Object();
+
+ // Special regular expression is needed to catch live streams and
+ // recorded ones. The keys are different.
+ result.video_id_re = new RegExp(
+ "(clip|\\\&t)=(pla[_-a-zA-Z0-9]+|[0-9]+)",
+ "i");
+
+ result.video_id_position = 1;
+
+ return result;
+}
+
// Makes a JSONP request that fetches the clip data in Livestream.com
LinternaMagica.prototype.request_livestreamcom_jsonp_data =
function (object_data)
@@ -84,6 +100,9 @@
channel = channel[channel.length-1];
+ var jsonp_key =
+ /pla[_A-Za-z0-9\-]+/i.test(object_data.video_id) ? "id" : "t";
+
var jsonp_request_data = new Object();
jsonp_request_data.frame_id = "livestreamcom_jsonp_data_fetcher";
@@ -91,7 +110,7 @@
jsonp_request_data.parser_timeout_counter =
this.livestream_jsonp_timeout_counter;
jsonp_request_data.jsonp_script_link = "http://x"+channel+
- "x.api.channel.livestream.com/3.0/getstream.json?id="+
+ "x.api.channel.livestream.com/3.0/getstream.json?"+jsonp_key+"="+
object_data.video_id+"&callback=livestreamcom_video_data";
"http://blip.tv/players/episode/"+object_data.video_id+
@@ -111,6 +130,53 @@
LinternaMagica.prototype.parse_livestreamcom_jsonp_data =
function(data,object_data)
{
- object_data.link = data.progressiveUrl;
+ object_data.link = data.progressiveUrl ?
+ data.progressiveUrl : data.rtspUrl;
+
+ if (data.progressiveUrl && data.rtspUrl)
+ {
+ object_data.hd_links = new Array();
+
+ var hd_link = new Object();
+ hd_link.label = this._("RTSP link");
+ hd_link.url = data.rtspUrl;
+ object_data.hd_links.push(hd_link);
+
+ hd_link = new Object();
+ hd_link.label = this._("Progressive link");
+ hd_link.url = data.progressiveUrl;
+ object_data.hd_links.push(hd_link);
+ }
+
this.create_video_object(object_data);
}
+
+LinternaMagica.prototype.sites["livestream.com"].css_fixes =
+function(object_data)
+{
+ var featured = document.getElementById("featured");
+ if (featured)
+ {
+ // A h2 element on front page and pages with categories of
+ // channel listings overlap the controls. It is a
+ // nextSibling.nextSibling of the featured element. Better
+ // use the third parent of the linterna magica object.
+ var lm =
+ document.getElementById("linterna-magica-"+
+ object_data.linterna_magica_id);
+ if (lm)
+ {
+ lm.parentNode.parentNode.parentNode.style.
+ setProperty("bottom", "60px", "important");
+ }
+ }
+
+ // Objects in dedicated channel pages are displaced 3px left.
+ var lm_object =
+ document.getElementById("linterna-magica-video-object-"+
+ object_data.linterna_magica_id);
+ if (lm_object)
+ {
+ lm_object.style.setProperty("left", "0px", "important");
+ }
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [linterna-magica-commit] [165] Fixes for tasks #11211.,
Ivaylo Valkov <=