First, thanks for replying, I took a look at the YouTube API but did not find what I was looking for just a couple of examples that I had difficulty understanding. So I entered the source code of the site from which I recorded the video and I'll post the codes I found here to see if you or someone else can can help me understand it and put it to work:
In a .js file I found:
// Adiciona vÃdeo ao STREAM
root.delegate('#includeVideoStream','click',function(){
var streamLink = getURL($("#stream-video").val());
if(streamLink && !$('#stream-link-status').attr('value')){
var video = $('#stream-video').val();
$('#add-stream-image').parent().hide();
$('#stream-description').append(video);
$('#stream-video').val('');
$('.formPublishVideo').hide();
$('#cont-video-publish').hide();
if(streamLink[0]=='YOUTUBE'){
var ajx = new ajxQuery({
'post' : '&videoID=' + streamLink[2],
'url' : SYS_URL + 'youtube',
'retorno' : 'json',
'onCarregando' : function(){},
'onRetorno' : function(json){
if(json[0]){
$('#stream-link-status').attr('value',1);
$('#stream-link').attr('value',streamLink[1]);
$('#stream-link-type').attr('value','YOUTUBE');
$('#stream-link-thumb').attr('value',json[2]);
$('#stream-link-title').attr('value',json[0]);
$('#stream-link-description').attr('value',json[1]);
$('#stream-link-embed').attr('value',json[3]);
$('#link-thumb').attr('src',json[2]);
$('#link-titulo').text(json[0]);
$('#link-description').text(json[1]);
$('#cont-stream-link').show();
}
}
});
ajx.conectar();
}
}
})
I also found in another separate .js file:
function getURL(text) {
var patternLink = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
var patternYoutube = /youtu(be.com|.b)(\/v\/|\/watch\?v=|e\/|\/watch(.+)v=)(.{11})/;
var er = new RegExp(patternLink);
var arLink = er.exec(text);
if(arLink){
var er = new RegExp(patternYoutube);
var arYoutube = er.exec(arLink[0]);
if(arYoutube){
return [
'YOUTUBE',
arLink[0],
arYoutube[4]
];
}else{
return [
'LINK',
arLink[0],
null
];
}
return true;
}else{
return false;
}
}
e:
/**************** START STREAM ********************/
function openVideo (newsID, param) {
var obj = $("#item-"+newsID+" .link-thumb");
$(obj).html("");
$(obj).css("paddingBottom","10px");
switch(param[0]){
case "YOUTUBE":
$(obj).append("<iframe width='408' height='230' src='http://www.youtube.com/embed/"+param[1]+"?wmode=transparent' frameborder='0' allowfullscreen></iframe>");
break;
}
}
function streamCapture () {
var streamLink = getURL($("#stream-text").val());
if(streamLink && !$('#stream-link-status').attr('value')){
if(streamLink[0] == 'YOUTUBE'){
var ajx = new ajxQuery({
'post' : '&videoID=' + streamLink[2],
'url' : SYS_URL + 'youtube',
'retorno' : 'json',
'onCarregando' : function(){
$('#content-loading').show();
},
'onRetorno' : function(json){
if(json[0]){
$('#stream-link-status').attr('value',1);
$('#stream-link').attr('value',streamLink[1]);
$('#stream-link-type').attr('value','YOUTUBE');
$('#stream-link-thumb').attr('value',json[2]);
$('#stream-link-title').attr('value',json[0]);
$('#stream-link-description').attr('value',json[1]);
$('#stream-link-embed').attr('value',json[3]);
$('#link-thumb').attr('src',json[2]);
$('#link-titulo').text(json[0]);
$('#link-description').text(json[1]);
$('#link').show();
}
$('#content-loading').hide();
}
});
ajx.conectar();
}else{
}
}
}
function closeLink () {
(
'# stream-link-status,' +
'# stream-link,' +
'# stream-link-type,' +
'# stream-link-thumb,' +
'# stream-link-title,' +
'# stream-link-description,' +
'# stream-link-embed'
) .attr ("value", "");
$ ('# link'). slideUp ();
$ ('# cont-addVideoPublish'). show ();
}
How can I use these files to do the same thing as the video? Thank you.