« Previous Next »

Thread: Logging with SSME

Last post 11-13-2009 4:16 PM by vsood. 7 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (8 items)

Sort Posts:

  • 10-24-2009, 2:41 PM

    • vsood
    • Top 75 Contributor
    • Joined on 07-12-2007, 1:16 AM
    • Redmond
    • Posts 84

    Logging with SSME

    Copied from a comment on my blog

    "We are working on samples and documentation". Great!  Hopefully they will cover the logging capabilities of the smooth streaming media element. I've noticed a couple of things while testing the logging capabilities so far.

    I was able to successfully get the control to post client logs by adding the LogUrl element to the .ismc file, but is there a way this can be configured dynamically through code?  I see that the control has a LoggingUrl property, but setting it does not seem to work.

    The control exposes a LogReady event but seems that this event only fires when playing non-smooth-stream content (i.e. when the Source property is set to a progressive download URL like a .wmv file).  When playing smooth stream content, the control does post the client logs but the event doesn't fire.

  • 10-24-2009, 2:42 PM In reply to

    • vsood
    • Top 75 Contributor
    • Joined on 07-12-2007, 1:16 AM
    • Redmond
    • Posts 84

    Re: Logging with SSME

    Hi,

    Can you please share what exactly you tried? Setting the URL either in XAML or code should have worked.

    Regards
    Vishal

  • 11-05-2009, 4:49 PM In reply to

    Re: Logging with SSME

    Hi Vishal,

    Basically I've got two TextBox controls, a Button, and a SmoothStreamingMediaElement in my page. The two TextBox controls let me specify the source url and the logging url.  In the click event for the button I've got the following:

    this.SmoothMediaElement.LoggingUrl = this.TextBoxLoggingUrl.Text;

    this.SmoothMediaElement.SmoothStreamingSource = new Uri(this.TextBoxSourceUrl.Text);

    I noticed that just setting the SmoothStreamingSource property does not automatically cause the media to begin playing (like it does for the MediaElement control), so I had to register a handler for the SmoothStreamingMediaElement.MediaOpened event, and in the handler I've got the following:

    this.SmoothMediaElement.Play();

    Now I've got an additional Button on the page which pauses the media within a click event:

    this.SmoothMediaElement.Pause();

    After the Pause() call occurs, I'd expect to see the page send a POST message containing the logging information to the Url which I set for the LoggingUrl property, but this POST message is not being sent (I'm using fiddler to spy on the traffic).

     Now, if I comment out the line where I set the LoggingUrl property and instead add the <LogUrl> section into my .ismc file, then I DO see the POST message being sent.

    Am I missing something or doing something wrong?

  • 11-06-2009, 2:15 PM In reply to

    Re: Logging with SSME

    And in regards to the logging capabilities that the control provides for progressive download...

    Are we to handle the LogReady event and use the information provided in the event args of that event?  Or does the control provide some other capability that I'm missing?  Or is this not going to be supported?

    The reason I'm asking these questions is because we have a solution which consists of silverlight players streaming .wmv through Windows Media Services via HTTP protocol, along with a custom logging plugin developed for Windows Media Services.  This logging plugin processes the logging info generated during playback and is then used to generate usage reports.

    Now, we are running into an issue with our silverlight players because there seems to be a nasty bug in the MediaElement control which causes it to not play nicely w/ corporate proxies when streaming through Windows Media Services (see http://forums.silverlight.net/forums/p/54649/294392.aspx). There is no problem w/ corporate proxies and progressive download through IIS though.

    Ideally we'd like the issue w/ corporate proxies & windows media services to be fixed for the MediaElement control, but in the absense of any response to this issue, we are trying to determine what it would require to get the same logging information when our players are playing progressive download through IIS.

    Swapping out our MediaElement and replacing it with the SmoothStreamingMediaElement seems like it could be a viable solution to our problem since it does seem to provide us with some logging capabilities (along with the added bonus of supporting playback of smooth streaming content if we decide to switch from .wmv to smooth stream content), but we're just trying to figure out exactly what logging capabilities we'll have available to us.

  • 11-08-2009, 3:40 PM In reply to

    • vsood
    • Top 75 Contributor
    • Joined on 07-12-2007, 1:16 AM
    • Redmond
    • Posts 84

    Re: Logging with SSME

    Hi

    You should use the AutoPlay property on SSME and set it to true if you want to be able to start playback on setting SmoothStreamingSource without calling Play.

    Setting the LoggingUrl should work. If the URL for your content and logging server are on different domains, you would need to make sure your ClientAccessPolicy.xml or CrossDomain.xml is set properly to allow that. SIlverlight will not allow it unless it is enabled via these files.

    LogReady event is not hooked up SSME yet for SmoothStreaming. However, I believe it would work for WMV files. I can cross-check but you can also try and see if it works. If not, please let me know.

    In future we are planning to giving all SS logging information through LogReady or similar APIs as well.

    Regards

    Vishal

  • 11-08-2009, 3:42 PM In reply to

    • vsood
    • Top 75 Contributor
    • Joined on 07-12-2007, 1:16 AM
    • Redmond
    • Posts 84

    Re: Logging with SSME

    One more thing forgot to mention, You can set the LoggingUrl through XAML too.

    <SSME:SmoothStreamingMediaElement x:Name="SmoothPlayer" LoggingUrl=http://abc.xyz/post.log EnableGPUAcceleration="True"/>

  • 11-13-2009, 4:06 PM In reply to

    Re: Logging with SSME

    Yep, setting the LoggingUrl through xaml works.

    And the LogReady event does fire w/ progressive download playback, just not w/ smooth streaming playback like you mentioned.  It would be ideal if this event fired for both because that would solve all of our logging needs.  We could simply handle the LogReady event in our player code and do whatever we want with it from there (POST to url, send to wcf service, output to debug window, etc.).

    I did some more testing w/ setting the LoggingUrl property through code.  Strange that if I set the LoggingUrl property in the constructor of my control or in a handler for the SSME control's Loaded event, the SSME control DOES post the logs to the url I specify. It just isn't working when I set it from my button click event. Maybe the SSME control is just expecting this to be set before it loads or something?  Because changing it once the control has loaded does not seem to have any effect.

  • 11-13-2009, 4:16 PM In reply to

    • vsood
    • Top 75 Contributor
    • Joined on 07-12-2007, 1:16 AM
    • Redmond
    • Posts 84

    Re: Logging with SSME

    justintgoetz:

    And the LogReady event does fire w/ progressive download playback, just not w/ smooth streaming playback like you mentioned.  It would be ideal if this event fired for both because that would solve all of our logging needs.  We could simply handle the LogReady event in our player code and do whatever we want with it from there (POST to url, send to wcf service, output to debug window, etc.).

     

    This is a feature on our list.

    justintgoetz:

    I did some more testing w/ setting the LoggingUrl property through code.  Strange that if I set the LoggingUrl property in the constructor of my control or in a handler for the SSME control's Loaded event, the SSME control DOES post the logs to the url I specify. It just isn't working when I set it from my button click event. Maybe the SSME control is just expecting this to be set before it loads or something?  Because changing it once the control has loaded does not seem to have any effect.

    This actually makes sense as SSME initializes logging only if required.

Page 1 of 1 (8 items)
Microsoft Communities