Making Outlook Work After Changing Your O365 Password
November 1, 2011
Creating Cross-Device Compatible Mobile Applications that Integrate with SharePoint
May 4, 2012

I’ve seen this issue pop up a few times over the last year or two and it again came up in a discussion recently, so I decided to blog it.

When you add a Content Query Web Part to a SharePoint Page the option to Play media links in browser is checked by default.

image

When this option is checked the PlayInMediaBrowser property is set to true.  Like this:

<property name="PlayMediaInBrowser" type="bool">True</property>

This value controls whether or not the Content Query Web Part loads the mediaplayer.js file that controls the SharePoint Silverlight Media Player and wires up the SharePoint Silverlight Media Player to play media files when links to them are clicked on the page.  Since some web browsers cannot handle Silverlight, setting this value to true could cause errors.

If you look at the source of the page when you add a Content Query Web Part it looks like this when PlayMediaInBrowser is set to true.

clip_image002

When you set PlayMediaInBrowser to false, or you remove the CQWP from the page, the code to load the media player disappears.

If you take a closer look at the Content Query Web Part you will see OnPreRender is what is loading the mediaplayer.js file and calling the functions to wire it up. OnPreRender looks at the PlayMediaInBrowser property and renders accordingly.

clip_image004

Make sure you hit CRTL-F5 when refreshing the browser page or clear your browser cache after making the changes or you will not see the change take effect.

If you want to learn more about the mediaplayer.js file and the functions SharePoint uses to wire up the SharePoint Silverlight Media Player or you want to wire up the SharePoint Silverlight Media Player yourself for a custom solution then check out the magazine article I wrote on this subject.

John Liu also discusses this topic in his blog post.