Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1003198 // hEmbedYoutube

JavaX fragment (include)

1  
static S hEmbedYoutube(S youtubeID) {
2  
  ret hEmbedYoutube(youtubeID, 300, 250);
3  
}
4  
5  
// text is HTML actually
6  
static S hEmbedYoutube(S youtubeID, int w, int h, S text) {
7  
  ret hEmbedYoutube(youtubeID, w, h).replace("View on YouTube", text);
8  
}
9  
10  
static S hEmbedYoutube(S youtubeID, int w, int h) {
11  
  youtubeID = extractYouTubeID(youtubeID);
12  
  ret "<object width=\"" + w + "\" height=\"" + h +"\"><param value=\"https://www.youtube.com/v/{*}&showsearch=0&rel=0&fs=1&autoplay=0&amp;ap=%2526fmt%3D18\" name=\"movie\" /><param value=\"window\" name=\"wmode\" /><param value=\"true\" name=\"allowFullScreen\" /><embed width=\"" + w + "\" height=\"" + h + "\" wmode=\"window\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" src=\"https://www.youtube.com/v/{*}&showsearch=0&fs=1&rel=0&autoplay=0&amp;ap=%2526fmt%3D18\"></embed></object><br /><a href=\"https://www.youtube.com/watch?v={*}\" target=\"_blank\">View on YouTube</a>".replace("{*}", youtubeID);
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003198
Snippet name: hEmbedYoutube
Eternal ID of this version: #1003198/5
Text MD5: 17de156fc7e7878ca079c0a8ab5e8340
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-23 22:55:47
Source code size: 975 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 544 / 803
Version history: 4 change(s)
Referenced in: [show references]