Hi everybody, new around and making my first (useful) script
The script I'm making is to easily watch YouTube Videos on MSN, when you send or received a Embed Video link it pops up a window asking if you want to see it, if you say yes, it opens a IE window without anything and with the correct size to view the video.
I'm almost finishing the script but I got a problem when I don't know how to solve it, here's the thing:
The YouTube embed link is this:
code:
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/aSdEfRgDFxA"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/aSdEfRgDFxA" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
When you send or receive it it will only show "YouTube Embed Link" and it will promp if you want to see it or not. When you say yes, it calls a function called InternetExplorer that opens the IE, but I still need the "IE.navigate()" code. I want to get it from the embed link. But I don't know how. It's a little dificuld to explain...
How can I get the link (in this example is "http://www.youtube.com/v/aSdEfRgDFxA") from the message you send/receive?
The code I have about it is this:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
var tubeoption = TubeOption.RegRead(TubeOptionPath);
Debug.Trace(tubeoption);
if(MessageKind == 1)
{
Debug.Trace("Text Message received/sent");
if(tubeoption == 1)
{
Message = Message.replace(/<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http:\/\/www\.youtube\.com\/v\/[A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_]\"><\/param><param name=\"wmode\" value=\"transparent\"><\/param><embed src=\"http:\/\/www\.youtube\.com\/v\/[A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_][A-Za-z0-9-_]\" type=\"application\/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"><\/embed><\/object>/g, "YouTube Embed Video Link");
if(Message == "YouTube Embed Video Link")
{
Debug.Trace("YouTube Embed Video Link");
MsgPlus.CreateWnd("youtubewindow.xml", "youtubequestion");
}
}
}
return Message;
}
function InternetExplorer(video)
{
IE.width = "450";
IE.height = "350";
IE.statusbar = false;
IE.toolbar = false;
IE.menubar = false;
IE.addressbar = false;
IE.visible = true;
IE.navigate(video);
}
function OnyoutubequestionEvent_CtrlClicked(PlusWnd, ControlId)
{
if(ControlId == "BtnYes")
{
InternetExplorer(video);
PlusWnd.Close(1);
}
if(ControlId == "BtnNo")
{
PlusWnd.Close(1);
}
}
Best Regards,
Joćo Godinho
P.S.: I don't know if there's an answer to my question already, I don't how to search it, if there is, my apologies.