Skip to content

Commit b787142

Browse files
committed
[general] better hosted brightcove
1 parent cc4d0ab commit b787142

File tree

2 files changed

+41
-25
lines changed

2 files changed

+41
-25
lines changed

plugins/domains/brightcove.com.js

-25
This file was deleted.

plugins/links/brightcove-hosted.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
3+
provides: '__promoUri',
4+
5+
getData: function(url, twitter) {
6+
7+
var video_src = (twitter.player && twitter.player.value) || twitter.player;
8+
if (!video_src || url.match(/^https?:\/\/link\.brightcove\.com\/services\/player\/bcpid(\d+)\?/i) ) return;
9+
// do not process links to itself, otherwise -> infinite recursion
10+
11+
var urlMatch = video_src.match(/^https?:\/\/link\.brightcove\.com\/services\/player\/bcpid(\d+)\?/i);
12+
13+
if (urlMatch) {
14+
15+
return {
16+
__promoUri: video_src
17+
}
18+
}
19+
}
20+
21+
/* Sample direct-video URLs:
22+
http://video-embed.masslive.com/services/player/bcpid1949030308001?bctid=3082707357001&bckey=AQ~~,AAAAQBxUOok~,jSZP67EiqBfkIeiCdBewgHg1-uVWQxpS
23+
http://video-embed.cleveland.com/services/player/bcpid1949055968001?bctid=3086114271001&bckey=AQ~~,AAAAQBxUNqE~,xKBGzTdiYSSRqIKPsPdkNW3W_DNtPBTa
24+
http://video.archstl.org/services/player/bcpid1697747652001?bckey=AQ~~,AAABKmWKzxE~,jhq2mLafyYPtb2fDysY2ou3LA4sZBXej&bctid=2766873636001&iframe=true&height=275&width=485
25+
http://video.popularmechanics.com/services/player/bcpid16382224001?bckey=AQ~~,AAAAAAyqBbs~,3zLG8i7OTQIWSRZG2AhyY0vOQ2Zz32h-&bctid=3087691540001
26+
http://video.billboard.com/services/player/bcpid3063835940001?bckey=AQ~~,AAAAAEMcC3Y~,NII8yi9nN4ynMSuZMypu6TcjvNjfaYWZ&bclid=3064795148001&bctid=3082031207001
27+
http://video-embed.nj.com/services/player/bcpid1950981419001?bctid=3092316229001&bckey=AQ~~,AAAAPLMILBk~,Vn8u6tPOf8Us2eD8W1ez5Zw-Ss_6Anfe
28+
http://video.bafta.org/services/player/bcpid601325186001?bckey=AQ~~,AAAABxWZS7k~,uLPjGIDNpTmMdurNjyFkV6rYlN-J6re3&bctid=753252127001
29+
30+
http://video-embed.masslive.com/services/player/bcpid1949030308001?bctid=3082707357001&bckey=AQ~~,AAAAQBxUOok~,jSZP67EiqBfkIeiCdBewgHg1-uVWQxpS
31+
http://video.symantec.com/services/player/bcpid975006955001?bckey=AQ%7E%7E%2CAAAABuIiy9k%7E%2CI8BhasVwr9wjJz4AWmdUlYymEtyorXkA&bctid=976391207001
32+
http://video.elcolombiano.com/services/player/bcpid2115059022001?bckey=AQ~~,AAABMdBKz4k~,kXKBkGGWjAV3BlMLVMYIIJUmR9KeWfwc&bctid=3082494089001
33+
http://video.scholastic.com/services/player/bcpid2602614477001?bckey=AQ~~,AAAAAFv844g~,BASb5BU03X9zO_bolhfjuH41AJVXYFl_&bctid=3027833348001
34+
http://trvideo.technologyreview.com/services/player/bcpid1237507476001?bckey=AQ~~,AAAAAAEgZvo~,jStb8wH-jnIlhYFjMUYJttcZynWzN1UG&bctid=1238876339001
35+
*/
36+
37+
/* Sample URLs with BrightCove Twitter Players:
38+
http://www.channel4.com/programmes/the-mill/videos/all/s1-ep2-the-introduction
39+
40+
*/
41+
};

0 commit comments

Comments
 (0)