The fastest way to get up and running with a video playback app is to bring in the Player Framework. (Hosted on codeplex) It will provide you will Closed Caption support and some nice playback controls (along with many other features).
As for the codec support, that is a bit harder. For Silverlight your best bet is to create a MediaStreamSource for the containers that WP doesn't support by default. Here is a nice article introducing the topic http://blogs.msdn.com/b/avib/archive/2010/03/10/silverlight-media-stream-source-part-1.aspx.
If you do not have to support WP8 then the new SDK for WP8.1 supports Media Extensions! http://code.msdn.microsoft.com/windowsapps/Media-extensions-sample-7b466096
Good Luck!