What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [help] msn chat windows

[help] msn chat windows
Author: Message:
LifelesS
Full Member
***


Posts: 115
Reputation: 4
31 / Male / Flag
Joined: Dec 2006
O.P. Huh?  [help] msn chat windows
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.

This post was edited on 12-09-2006 at 04:58 PM by LifelesS.
12-09-2006 04:52 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[help] msn chat windows - by LifelesS on 12-09-2006 at 04:52 PM
RE: [help] msn chat windows - by Matti on 12-09-2006 at 06:27 PM
RE: [help] msn chat windows - by Felu on 12-09-2006 at 06:29 PM
RE: [help] msn chat windows - by Plik on 12-09-2006 at 06:38 PM
RE: [help] msn chat windows - by LifelesS on 12-09-2006 at 08:25 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On