Home
Blogs
Forums
Files


Welcome to The Green Button          Sign in | Join | Help

MediaTransport - unable to get current object

Last post 08-19-2008, 12:24 PM by Ken P. 3 replies.
Sort Posts: Previous Next
  •  08-13-2008, 11:31 AM 284669

    MediaTransport - unable to get current object

    Hi there,

    I have a background application with the following code:


            private MediaTransport CurrentMediaTransport
            {
                get
                {
                    MediaCenterEnvironment env = host.MediaCenterEnvironment;
                    if (env != null)
                    {
                        MediaExperience exp = env.MediaExperience;
                        if (exp != null) return exp.Transport;
                    }
                    return null;
                }
            }


            public void Start()
            {

                bool check = true;

                while (check)
                {
                    MediaTransport mt = CurrentMediaTransport;

                    if (mt != null)
                    {
                        DialogTest("Not null");
                        mt.PropertyChanged += new PropertyChangedEventHandler(mt_PropertyChanged);
                        check = false;

                    }
                    else
                    {
                        DialogTest("null");
                    }


                    Thread.Sleep(10000);
                }

            }

            void mt_PropertyChanged(IPropertyObject sender, string property)
            {
                //throw new NotImplementedException();
                DialogTest(property);
            }


    Basically, I am trying to get the current MediaTransport object, but it always returns null for me?

    Why is this? I've done a bit of searching, but couldn't find anything that would answer my question.

    I did however find out that the MediaTransport expires if left alone for a period of time, is this still the case? (I ask as I will need to do something with this information in future).

    I'm not the most experienced programmer so try not to go into too much technical speak :p

    Thanks.
    Ben Barron's Online Web Design & Applications Portfolio
  •  08-19-2008, 11:44 AM 286316 in reply to 284669

    Re: MediaTransport - unable to get current object

    Just curious,  are you running this code on a PC with the TV Pack installed?
  •  08-19-2008, 11:52 AM 286320 in reply to 286316

    Re: MediaTransport - unable to get current object

    Ken P:
    Just curious,  are you running this code on a PC with the TV Pack installed?


    Yeah I am.

    Ben Barron's Online Web Design & Applications Portfolio
  •  08-19-2008, 12:24 PM 286339 in reply to 286320

    Re: MediaTransport - unable to get current object

    I am no expert, but I think that the TV Pack breaks some (or all?) of the MediaTransport stuff.  I am not sure, but I would guess this is why the commercial skip in DVRMSToolbox no longer works.....and your code.
View as RSS news feed in XML
About TGB | Advertise | Link To Us | Donate | Terms Of Use | Privacy Policy
© 2003-2007 The Green Button, Inc. - All Rights Reserved