How do you do the simplest of bindings with this control??

11 posts, 0 answers
  1. Arash Emami
    Arash Emami avatar
    6 posts
    Member since:
    Mar 2010

    Posted 05 Apr 2010 Link to this post

    I'm flabbergasted as to why the most basic of databinding scenarios is not working with your control.

    I have a RadMediaPlayer and I want to bind my video URL to it.  That's all.

    From looking at your examples, it seems like it is necessary to have a RadMediaItem inside it, but this doesn't work:

         <telerikMedia:RadMediaPlayer HorizontalAlignment="Left" Margin="28,70,0,157" Width="301" Header=""  SelectedIndex="0">
         <telerikMedia:RadMediaItem Source="{Binding Item1.LowResVideoUrl}"/>
         </telerikMedia:RadMediaPlayer>

    What am I missing here?  Why is the most basic of binding scenarios difficult with this control?
  2. Vladislav
    Admin
    Vladislav avatar
    276 posts

    Posted 07 Apr 2010 Link to this post

    Hello Arash Emami,

    I have prepared a sample project demonstrating a very basic binding scenario.
    Can you please check it and let us know if it works for you?

    Any additional comments are highly appreciated.

    Best wishes,
    Vladislav
    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.
  3. DevCraft banner
  4. Jim
    Jim avatar
    4 posts
    Member since:
    Nov 2009

    Posted 14 Apr 2010 Link to this post

    Thanks for the sample project - it seems the key is to set SelectedIndex="0" on the RadMediaPlayer.  I found that setting IsSelected="True" on the RadMediaItem seems to do the same thing.

    The problem though is that the video then starts playing automatically, even with AutoPlay="False".  Apparently the act of setting the selected item for the media player also starts that selected item playing.  How can I use this without having the video auto-play?

    Thanks,
    Jim
  5. Vladislav
    Admin
    Vladislav avatar
    276 posts

    Posted 16 Apr 2010 Link to this post

    Hi Jim,

    The "AutoPlay" property of the RadMediaPlayer is obsolete.
    Anyway we have plans to implement a similar property. This issue is logged in our PITS application under the title "MediaPlayer: AutoPlay support". You can track its progress there and vote for it.

    In the meantime you can use the attached project as a workaround.

    Kind regards,
    Vladislav
    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.
  6. Jim Miles
    Jim Miles avatar
    22 posts
    Member since:
    May 2006

    Posted 26 Jul 2010 Link to this post

    Hi, I'm doing some testing with the media player and just want to play a video (Silverlight 4, Rad Q1 2010).  Does the mediaplayer require a binded source?  Can it just be a URL to the video? (http://mysite/video.wmv)

    Trying to do a simple sample like in the documentation and the media player says "Failed to load media".

    <telerikMediaPlayer:RadMediaPlayer Width="600" Height="400" Margin="20">
    <
    telerikMediaPlayer:RadMediaItem
    Source=http://mschnlnine.vo.llnwd.net/d1/ch9/7/1/5/1/2/4/DynamicsDuoCRMSilverlight_ch9.wmv
    Header="The Dynamics Duo talk about CRM and Silverlight" />
    </
    telerikMediaPlayer:RadMediaPlayer>

    (from ms-help://telerik.windows.controls.Silverlight/telerik.windows.controls.mediaplayer/radmediaplayer-populating.html)

    I updated it to the following for my sample:

     
    <telerikMedia:RadMediaPlayer Margin="261,39,16,4" Header="" Background="Black" EnableFullScreenIcon="True" Grid.Row="1" AutoPlay="true" >
             <telerikMedia:RadMediaItem Source="http://mschnlnine.vo.llnwd.net/d1/ch9/7/1/5/1/2/4/DynamicsDuoCRMSilverlight_ch9.wmv" Header="The Dynamics Duo talk about CRM and Silverlight" IsStreamingSource="false" />
     </telerikMedia:RadMediaPlayer>

    I'm also working with the demo Rad controls and it's been over 30 days, would that have an affect?

    Thanks,
    -jim
  7. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 27 Jul 2010 Link to this post

    Hello Jim Miles,

    Can you please make sure that you start your Silverlight application with Web project and web page? (your page should be hosted in http environmental). Silverlight is restricting cross-schema media playing - from local silverlight app C:// to http video.
    You do not need bound source and should work the way you pasted it.
    Please let us know if this does not help 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
  8. Jim Miles
    Jim Miles avatar
    22 posts
    Member since:
    May 2006

    Posted 27 Jul 2010 Link to this post

    Thanks Miro, that seemed to be the issue.  I created a fresh project with just the video player and it works.  My other project was also in a web page, but it didn't have some of the normal web app options in VS 2010, so must be something with converting it from a Blend project?  Anyhow...

    Thanks
    -jim
  9. Terry
    Terry avatar
    11 posts
    Member since:
    Jul 2010

    Posted 11 Aug 2010 Link to this post

    How do you bind a video that is in a sub folder of the web application?

    I took the example and tried modifying the sample app from this thread as this:

    this.Item1.LowResVideoUrl = "../Video/Demo2.wmv";

    The RadMediaPlayer shows, but it has a white area with a red X and the message "Failed to open media!"

    I'm running with Silverlight 4 and VS 2010. 

    If I change that line to

    this.Item1.LowResVideoUrl = "http://localhost:4778/Video/Demo2.wmv";

    the video plays correctly.
  10. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 16 Aug 2010 Link to this post

    Hi Terry,

    Can you try this.Item1.LowResVideoUrl = "/../Video/Demo2.wmv"; because starting with "/" means relative to the App. web root, while without "/" is relative to the xaml file where you declared the MediaPlayer.
    Hope will help 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
  11. R
    R avatar
    4 posts
    Member since:
    Feb 2013

    Posted 06 Feb 2013 Link to this post

    I am facing the same problem..how did u fix it?
    The above solution by Miro dosent work.
  12. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 08 Feb 2013 Link to this post

    Hello,

    If the video file is hosted on the server, then you can get its url and pass it as a source to the RadMediaItem:
    <telerik:RadMediaPlayer>
        <telerik:RadMediaItem Header="Video 1"
                Source="http://localhost:27613/videos/telerik.wmv" />
    </telerik:RadMediaPlayer>

    Please find attached a sample solution demonstrating this approach.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner