This is a migrated thread and some comments may be shown as answers.

Item Template and Smooth Stream

4 Answers 37 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Luis
Top achievements
Rank 1
Luis asked on 01 May 2010, 06:51 PM

Hi there,
I have the following template that is almost as the one on the example, with two added properties: IsStreamingSource and
StreamAttached. However it does not activate the event handler on the StreamAttached.

<telerikMedia:RadMediaPlayer x:Name="player"   
                                     VerticalContentAlignment="Top"   
                                     HorizontalContentAlignment="Center" 
                                     FullScreenChanged="player_FullScreenChanged"   
                                     AutoPlaylistAdvance="False">  
            <telerikMedia:RadMediaPlayer.ItemTemplate> 
                <DataTemplate> 
                    <telerik:ContainerBinding.ContainerBindings> 
                        <telerik:ContainerBindingCollection> 
                            <telerik:ContainerBinding PropertyName="Source" Binding="{Binding Source}" /> 
                            <telerik:ContainerBinding PropertyName="IsStreamingSource" Binding="{Binding IsStreamingSource}" /> 
                            <telerik:ContainerBinding PropertyName="StreamAttached" Binding="{Binding StreamAttached}" /> 
                        </telerik:ContainerBindingCollection> 
                    </telerik:ContainerBinding.ContainerBindings> 
 
                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">  
                        <Image Source="{Binding Image}" Width="200" Height="180" Stretch="Uniform" Margin="4" /> 
                        <TextBlock Text="{Binding Title}" VerticalAlignment="Center" Margin="4" /> 
                    </StackPanel> 
                </DataTemplate> 
            </telerikMedia:RadMediaPlayer.ItemTemplate> 
        </telerikMedia:RadMediaPlayer> 
 
 

Can you please help me to make this to work.
Thanks

4 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 05 May 2010, 12:38 PM
Hello Luis,

StreamAttached is an event, not a property and you can't bind it with ContainerBinding.  Currently you can't also handle the event using class handler, because StreamAttached isn't RoutedEvent. We logged this and will be fixed for next releases. Till then it appears that you can't bind the RadMediaPlayer to items that are Smooth Streaming sources. You'll need to create the RadMediaItems yourself and attach the StreamAttached handlers manually in the code.
If you have further questions regarding RadMediaPlayer, please contact us.

Sincerely yours,
Miro Miroslavov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Luis
Top achievements
Rank 1
answered on 05 May 2010, 04:58 PM
Thanks for the response. Can you please provide an example of your suggestion?
0
Miro Miroslavov
Telerik team
answered on 11 May 2010, 07:12 AM
Hello Luis,

 You can write code to create RadMediaItems like follows (suppose you have RadMediaPlayer called player and model classes that holds media related data - Mediaitem - the classes you bind in the previous exampe):

foreach (MediaItem item in GetMediaItems())
{
    RadMediaItem radItem = new RadMediaItem();
    radItem .Source = item.Source;
    radItem.IsStreamingSource = item.IsStreamingSource;
    radItem.StreamAttached = new EventHandler(item_StreamAttached);
}

And this is your the EventHandler for StreamAttached:
void item_StreamAttached(object sender, EventArgs e)
        {
            //Your code here for handling streams.
        }

Hope this helps you.

Regards,
Miro Miroslavov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Miro Miroslavov
Telerik team
answered on 11 May 2010, 07:13 AM
Hello Luis,

 You can write code to create RadMediaItems like follows (suppose you have RadMediaPlayer called player and model classes that holds media related data - Mediaitem - the classes you bind in the previous exampe):

foreach (MediaItem item in GetMediaItems())
{
    RadMediaItem radItem = new RadMediaItem();
    radItem .Source = item.Source;
    radItem.IsStreamingSource = item.IsStreamingSource;
    radItem.StreamAttached = new EventHandler(item_StreamAttached);
      player.Items.Add(radItem);
}

And this is your the EventHandler for StreamAttached:
void item_StreamAttached(object sender, EventArgs e)
        {
            //Your code here for handling streams.
        }

Hope this helps you.


Regards,
Miro Miroslavov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
MediaPlayer
Asked by
Luis
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Luis
Top achievements
Rank 1
Share this question
or