I know SL3 is still in beta preventing so support is limited, however I wanted to point out a runtime error that I is being thrown from the MediaPlayer.dll and that I cant access to fix.:) Below is the error message I am getting along with the xaml and xaml.cs code. Not sure if it matters or not, but I am using Prism and injecting views including the UserControl that hosts the MediaPlayer control. I really like the media player so any workaround suggestions would be wonderful! Thank you!
Microsoft JScript runtime error: Unhandled Error in Silverlight 2 Application Specified cast is not valid. at Telerik.Windows.Controls.ItemsCountToIsEnabledConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
at System.Windows.Data.BindingExpression.ConvertToTarget(Object value)
at System.Windows.Data.BindingExpression.GetValue(DependencyObject d, DependencyProperty dp)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.FrameworkElement.SetBinding(DependencyProperty dp, Binding binding)
at Telerik.Windows.Controls.RadMediaPlayer.MediaElement_MediaOpened(Object sender, RoutedEventArgs e)
at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
XAML.CS
private
VideosViewModel model;
public VideosViewModel Model
{
get
{
return this.model;
}
set
{
this.model = value;
this.DataContext = model;
if (model != null && model.MediaCollection.Count() > 0)
{
foreach (var item in model.MediaCollection)
{
var imgs = new BitmapImage(new Uri(string.Concat(thumbPrefix, item.ThumbnailUrl)));
var src = new Uri(String.Format("{0}/{1}", streamPrefix, item.SourceUrl.Substring(11)));
player.Items.Add(
new RadMediaItem() { ImageSource = imgs, Source = src, Title = item.Title, Description = item.Description });
}
var v = player.Items;
var t = player.CurrentItem;
}
}
}
.XAML
<
UserControl x:Class="Verb.Modules.Showcase.Views.VideosPlayerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:media="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.MediaPlayer"
>
<Grid x:Name="LayoutRoot" Background="White">
<media:RadMediaPlayer x:Name="player" />
</Grid>
</
UserControl>