locked
How do I create a media player? RRS feed

  • Question

  • What happened to the Media Player in SL3? I want to create a Media Player to run on my asp.net page, how would I go about doing this? Do I have to create a SL3 project, and then use Encoder to add a Media Element? There used to be a Media Player in the Silverlight Toolbox before, but it seems to be gone. None of the videos/tutorials on this are up to date on the web.

    Thanks

     

    Tuesday, April 6, 2010 3:20 AM

Answers

  • I dont want to create a player from scratch, here is what I did so far:

    In Expression Encoder 3, I used an old avi file and encoded it. In the output section, I did select the template as 'Expression' ...that is the template and features that I want in my player.

    After the file encoded, it created the html page and the xap files. Now, what do I need to do to use the template and create my own player?

    I want to dynamically assign the videos that will be played (kind of like Youtube).

    Where can I find the code to create a player like this: http://www.asp.net/learn/3.5-SP1/video-243.aspx I am especially interested in the adding comments to the video part as well.

    Thanks

    Tuesday, April 6, 2010 12:57 PM

All replies

  • Good Question i also want to know about it.
    Tuesday, April 6, 2010 3:29 AM
  • Hi,

       If you have to create a video player in Silverlight 3, you have the option through Expression Encoder ( easy way) and also you can open the same player template in Expression Blend and create your customised player with the rich functinalities wired with Expression Encoder players.

    Or other way out is you can create the media player from scratch which I have done using Mediaelement and making the custom controls like stop, play/pause , sliders( voulme and player), Playlist, uploading and downloading the video to play on selection in playlist.

    Thats the way you can use.

     

    Cheers,

    please mark this as answered if it solves your query.

    Tuesday, April 6, 2010 3:36 AM
  • I dont want to create a player from scratch, here is what I did so far:

    In Expression Encoder 3, I used an old avi file and encoded it. In the output section, I did select the template as 'Expression' ...that is the template and features that I want in my player.

    After the file encoded, it created the html page and the xap files. Now, what do I need to do to use the template and create my own player?

    I want to dynamically assign the videos that will be played (kind of like Youtube).

    Thanks

     

    EDIT: Where can I find the code to create a player like this: http://www.asp.net/learn/3.5-SP1/video-243.aspx

    I am especially interested in the adding comments to the video part as well. Thanks

    Tuesday, April 6, 2010 3:46 AM
  •  Hi,

    refer this http://timheuer.com/blog/archive/2007/08/31/cheating-creating-silverlight-media-player.aspx

     

     

    This is VERY outdated. There is nothing useful here because the Encoder 3 doesnt create a CSPROJ anymore.

    Tuesday, April 6, 2010 3:58 AM
  • I dont want to create a player from scratch, here is what I did so far:

    In Expression Encoder 3, I used an old avi file and encoded it. In the output section, I did select the template as 'Expression' ...that is the template and features that I want in my player.

    After the file encoded, it created the html page and the xap files. Now, what do I need to do to use the template and create my own player?

    I want to dynamically assign the videos that will be played (kind of like Youtube).

    Where can I find the code to create a player like this: http://www.asp.net/learn/3.5-SP1/video-243.aspx I am especially interested in the adding comments to the video part as well.

    Thanks

    Tuesday, April 6, 2010 12:57 PM
  • I dont want to create a player from scratch, here is what I did so far:

    In Expression Encoder 3, I used an old avi file and encoded it. In the output section, I did select the template as 'Expression' ...that is the template and features that I want in my player.

    After the file encoded, it created the html page and the xap files. Now, what do I need to do to use the template and create my own player?

    I want to dynamically assign the videos that will be played (kind of like Youtube).

    Where can I find the code to create a player like this: http://www.asp.net/learn/3.5-SP1/video-243.aspx I am especially interested in the adding comments to the video part as well.

    Thanks

     

     

    take a look  here.

     

    There will be 4 projs in the template solution, expressionPlayer,pluginmmsctrl,mediaplayer and the templated player. you have to add your video switching logic to the template player or adapt it and integrate into your existing project.

    in xaml, your player tag should look something like this

     
    <ExpressionPlayer:ExpressionPlayer Margin="0,0,0,0"
                                               x:Name="myPlayer">
                <ExpressionPlayer:ExpressionPlayer.Playlist>
                    <ExpressionMediaPlayer:Playlist>
                        <ExpressionMediaPlayer:Playlist.Items>
                            <ExpressionMediaPlayer:PlaylistItem MediaSource="http://localhost/myvideo.wmv"></ExpressionMediaPlayer:PlaylistItem>
                        </ExpressionMediaPlayer:Playlist.Items>
                    </ExpressionMediaPlayer:Playlist>
                </ExpressionPlayer:ExpressionPlayer.Playlist>
            </ExpressionPlayer:ExpressionPlayer>
      

    change mediasource to play different video, which you can do via javascript  or other means. you will notice a bunch of styling code which you can edit as well.

    Monday, May 17, 2010 7:09 AM
  •  Check this post

    http://forums.silverlight.net/forums/p/181881/411709.aspx

    The ASP .NET Silverlight and MediaPlayer controls were part of the Silverlight 2 Tools for Visual Studio. You can get them back by uninstalling the Silverlight 3 tools, installing Silverlight 2 Tools, then reinstalling the Silverlight 3 Tools, then uninstalling the Silverlight 2 Tools (the controls remain after uninstall, but you have to uninstall because VS will crash all the time with both 2 and 3 developer tools installed). It's convoluted, but it worked for me in VS2008.

    Monday, May 17, 2010 11:09 AM