Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 233541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:06:40+00:00 2026-05-11T20:06:40+00:00

I am using VSTS 2008 with C# to develop Silverlight application embedded in web

  • 0

I am using VSTS 2008 with C# to develop Silverlight application embedded in web page of an ASP.Net web application. I have embedded in XAML a MediaElement item. My question is, I want to embed the page a Silverlight media player, which could let end user to control the MediaElement item manually to — play/pause/stop/rewind/forward. Are there any references samples?

thanks in advance,
George

EDIT1: add more accurate requirements,

Actually, I want to control play manually, which means I want to handle the player play/pause/stop/rewind/forward events and add my code for the event handlers to control the MediaElement and do something else.

EDIT2: My needs are, I want to play two overlapped video. Screen as background video and camera as foreground video (place at right bottom corner). Here is my modification of code, my current issue is, only background video is played, foreground right bottom video is never played. Does anyone have any ideas why?

BTW: my modified code and current work is based on http://www.codeplex.com/sl2videoplayer

http://www.yourfilehost.com/media.php?cat=other&file=sl2videoplayer_24325_new.zip

Here is a brief description of my major modified code,

mediaControls.xaml.cs

private MediaElement _media = null;
private MediaElement _camera = null;

public MediaElement Camera
{
    set
    {
        _camera = value;
    }
}

void btnPlay_Checked(object sender, RoutedEventArgs e)
{
    _camera.Play();            
    _media.Play();
    OnPlayClicked();
}

Page.xaml

    <MediaElement HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="mediaPlayer" Stretch="Uniform" VerticalAlignment="Stretch" AutoPlay="false"/>
    <MediaElement Width="100" Height="100" x:Name="cameraPlayer" AutoPlay="false" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>

Page.xaml.cs

cameraPlayer.Source = App.Current.Resources["c"] as Uri;

App.xaml.cs (Application_Startup function)

        else if (item.Key.ToLower() == "c")
        {
            FormatUri(e.InitParams["c"].ToString(), "c", false);
        }

default.html

        <param name="initParams" value="cc=true,markers=true,markerpath=markers_movie21.xml,m=http://localhost/screen.wmv,c=http://localhost/camera.wmv" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:06:40+00:00Added an answer on May 11, 2026 at 8:06 pm

    Oh baby have I got the media player for you: Sl2 Video Player. MSPL open sourced and awesome.

    To add the ability to control the player pragmatically, add ScriptableMembers.
    You’ll see the registration statement already in the code:

        HtmlPage.RegisterScriptableObject("Page", page);
    

    Now look at an example ScriptableMember:

    [ScriptableMember]
    public void SeekPlayback(string time)
    {
        TimeSpan tsTime = TimeSpan.Parse(time);
        mediaControls.Seek(tsTime);
    }
    

    already exists in the code. Add more methods to do what you want to have happen. Then you can call the methods from managed code in another SL player:

    HtmlElement videoPlugin = HtmlPage.Document.GetElementById("VideoPlayer");
                if (videoPlugin != null)
                {
                    ScriptObject mediaPlayer = (ScriptObject)((ScriptObject)videoPlugin.GetProperty("Content")).GetProperty("Page");
    
                    mediaPlayer.Invoke("SeekPlayback", TimeSpan.FromSeconds(seconds).ToString());
    
                }
    

    or from javascript:

            var sl = document.getElementById("VideoPlayer");
            var content = sl.Content.Page;
            content.SeekPlayback('55');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 149k
  • Answers 149k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer According to W3C URI's in non ASCII should be escaped… May 12, 2026 at 9:32 am
  • Editorial Team
    Editorial Team added an answer If your books don't give you tasks to chew on,… May 12, 2026 at 9:32 am
  • Editorial Team
    Editorial Team added an answer Finally got it to work by doing the following: Adding… May 12, 2026 at 9:32 am

Related Questions

I've spent 4 years developing C++ using Visual Studio 2008 for a commercial company;
I am using VSTS 2008 + C# + .NET 3.0. I am using a
I am using VSTS 2008 with both the developer and database editions installed. I
I am using VSTS 2008 + C# + .Net 3.5 to read Excel file

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.