[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linterna-magica-commit] [96] Merging r95 from trunk.
From: |
Ivaylo Valkov |
Subject: |
[linterna-magica-commit] [96] Merging r95 from trunk. |
Date: |
Tue, 14 Jun 2011 22:37:55 +0000 |
Revision: 96
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=96
Author: valkov
Date: 2011-06-14 22:37:54 +0000 (Tue, 14 Jun 2011)
Log Message:
-----------
Merging r95 from trunk. Fixes (again) Blip.tv
Revision Links:
--------------
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=95
Modified Paths:
--------------
branches/0.0.9/src/lm_extract_dom_objects.js
branches/0.0.9/src/lm_extract_video_link.js
branches/0.0.9/src/lm_site_bliptv.js
branches/0.0.9/src/lm_xhr.js
Property Changed:
----------------
branches/0.0.9/
Property changes on: branches/0.0.9
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk:6,9,11,13,19,21,52,55,57,67,73,81,84-85,90
+ /trunk:6,9,11,13,19,21,52,55,57,67,73,81,84-85,90,95
Modified: branches/0.0.9/src/lm_extract_dom_objects.js
===================================================================
--- branches/0.0.9/src/lm_extract_dom_objects.js 2011-06-14 22:35:00 UTC
(rev 95)
+++ branches/0.0.9/src/lm_extract_dom_objects.js 2011-06-14 22:37:54 UTC
(rev 96)
@@ -251,11 +251,11 @@
self.request_video_link.apply(self,[data]);
}, this.wait_dailymotion);
}
- else if (/blip\.tv/i.test(window.location.hostname) ||
- (object.hasAttribute('src') &&
+ else if (!/blip\.tv/i.test(window.location.hostname) &&
+ ((object.hasAttribute('src') &&
/blip\.tv/i.test(object.getAttribute('src'))) ||
(object.hasAttribute('data') &&
- /blip\.tv/i.test(object.getAttribute('data'))))
+ /blip\.tv/i.test(object.getAttribute('data')))))
{
this.request_bliptv_jsonp_data(object_data);
}
Modified: branches/0.0.9/src/lm_extract_video_link.js
===================================================================
--- branches/0.0.9/src/lm_extract_video_link.js 2011-06-14 22:35:00 UTC (rev 95)
+++ branches/0.0.9/src/lm_extract_video_link.js 2011-06-14 22:37:54 UTC (rev 96)
@@ -245,7 +245,7 @@
// the data.
// http://wiki.blip.tv/index.php/Extract_metadata_from_our_embed_code
video_id_re = new RegExp(
- "blip\\\.tv\\\/play\\\/(.*)",
+ "blip\\\.tv\\\/(play|rss\\\/flash)\\\/([0-9A-Za-z_%-]+)&*",
"i");
}
else
Modified: branches/0.0.9/src/lm_site_bliptv.js
===================================================================
--- branches/0.0.9/src/lm_site_bliptv.js 2011-06-14 22:35:00 UTC (rev 95)
+++ branches/0.0.9/src/lm_site_bliptv.js 2011-06-14 22:37:54 UTC (rev 96)
@@ -50,8 +50,8 @@
// Parses the JSONP data and creates the video object in Blip.tv
LinternaMagica.prototype.parse_bliptv_jsonp_data = function(data, object_data)
{
- // The useful object is inside two arrays
- data = data[0][0];
+ // The useful object
+ data = data[0].Post;
object_data.link = data.mediaUrl;
var hd_links = new Array();
@@ -60,8 +60,8 @@
// list bottom to top , low to high.
var sort_fun = function(a, b)
{
- return ((a.width > b.width) ? -1 :
- (a.width < b.width) ? 1 :0);
+ return ((parseInt(a.media_width) > parseInt(b.media_width)) ? -1 :
+ (parseInt(a.media_width) < parseInt(b.media_width)) ? 1 :0);
};
data.additionalMedia.sort(sort_fun);
@@ -72,8 +72,12 @@
var link = new Object();
link.url = link_data.url;
link.label = link_data.role+
- " ("+link_data.width+"x"+link_data.height+")";
+ " ("+link_data.media_width+"x"+link_data.media_height+" "+
+ " "+link_data.description+" "+
+ link_data.video_codec.toUpperCase()+", "+
+ link_data.audio_codec.toUpperCase()+")";
+
hd_links.push(link);
}
Modified: branches/0.0.9/src/lm_xhr.js
===================================================================
--- branches/0.0.9/src/lm_xhr.js 2011-06-14 22:35:00 UTC (rev 95)
+++ branches/0.0.9/src/lm_xhr.js 2011-06-14 22:37:54 UTC (rev 96)
@@ -167,6 +167,11 @@
address = "/ajax/onn/embed/"+video_id+".json";
}
+ if (/blip\.tv/i.test(host))
+ {
+ address="/rss/flash/"+video_id;
+ }
+
var self = this;
client.onreadystatechange = function() {
var client = this;
@@ -448,6 +453,24 @@
url = onion_data.video_url;
}
+ if (/blip\.tv/i.test(host))
+ {
+ // All the data is available in the XML, but it is not a
+ // good idea to support the site in two places. JSON is
+ // easier. The drawback is two requests.
+ var embed_id =
+ xml.getElementsByTagName("embedLookup");
+
+ if (!embed_id)
+ {
+ return null;
+ }
+
+ object_data.video_id = embed_id[0].textContent;
+ this.request_bliptv_jsonp_data(object_data);
+ return null;
+ }
+
if (!url)
{
return;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [linterna-magica-commit] [96] Merging r95 from trunk.,
Ivaylo Valkov <=