locked
In my ASP.NET application- embed media player volume retain issue RRS feed

  • Question

  • Hi,

    I have an embed mediaplayer object into my asp.net application, where i'm passing the audio files do it from datagrid.

    Issue here is, when i set some volume in the mediaplayer and click onany audio file (play button) then the volume get backs to the original default volume and it is not storing that volume anywhere how to resolve this.

    The volume that am selecting should be for that particular session.

    help me out with this.

    My code snippet:

    <p>

     
             <object id="MediaPlayer" width="300" height="150" name="MediaPlayer"
        classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components..."
        type="application/x-oleobject">
        <param name="Url" value="<%=FileName %>">
        <param name="AutoSize" value="true">
        <param name="AutoStart" value="true">
        <param name="Balance" value="0">
        <param name="DisplaySize" value="0">
        <param name="Mute" value="false">
        <param name="PlayCount" value="0">
        <param name="Rate" value="1.0">
        <param name="ShowAudioControls" value="true">
        <param name="ShowControls" value="true">
        <param name="ShowDisplay" value="true">
        <param name="ShowStatusBar" value="true">
        <param name="ShowTracker" value="true">
        <param name="StretchToFit" value="false">
        <param name="TransparentAtStart" value="false">
        <param name="Volume" value="50">
        <embed type="application/x-mplayer2"
            name="mediaplayer" pluginspage="http://www.microsoft.com/Windows/MediaPlayer" src="<%=FileName %>"
            Height="300" Width="300" AutoSize="1" AutoStart="1" Balance="0" DisplaySize="0" Mute="0"
            PlayCount="0" Rate="1.0" ShowAudioControls="1" ShowControls="1" ShowDisplay="1" ShowStatusBar="1"
            ShowTracker="1" StretchToFit="0" TransparentAtStart="0" Volume="30">
        </embed>
    </object>

    </P>

    (or) i tried building it programatically as shown below:

     public void addControl()
            {
                StringBuilder sb = new StringBuilder();
                string url = FileName;
                Volume = 40;
                sb.Append("<object classid='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6' id= 'Player1' width='Auto'height='Auto'>");
                sb.Append("<param name='URL' value='" + url + "' />");
                sb.Append("<param name='AutoStart' value='false'>");
                sb.Append("<param name='ShowControls' value='true'>");
                sb.Append("<param name='ShowStatusBar' value='true'>");
                sb.Append("<param name='allowfullscreen' value='false'>");
                sb.Append("<param name='animationatstart' value='false'>");
                sb.Append("<param name='transparentatstart' value='true'>");
                sb.Append("<param name='ShowDisplay' value='false'>");
                sb.Append("<param name='stretchToFit' value='false'>");
                sb.Append("<param name='volume' value='"+Volume+"' />");
                sb.Append("<embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/' width='500' height='350' filename='" + url + "' src='" + url + "' autostart='1' showcontrols='1' showstatusbar='1' showdisplay='1'>");
                sb.Append("</embed>");
                sb.Append("</object>");
                ltPlayer.Text = sb.ToString();
            }

    in page_load()

    {if(!IsPostBack)

    {

    addcontrol();

    //code which displays audio into datagrid

    }

    }

    Thanks,

    Hiranmayee

    Tuesday, May 19, 2015 10:29 AM

Answers

  • Hi, 

    The right forum to discuss this case is http://forums.asp.net/, here you can discuss C# code related issue in specific.

    Thank you.


    Fouad Roumieh

    • Proposed as answer by Just Karl Wednesday, May 20, 2015 3:15 PM
    • Marked as answer by Just Karl Friday, May 29, 2015 4:05 PM
    Tuesday, May 19, 2015 10:59 AM
  • Questions related to ASP.NET should be posted in the ASP.NET forums (http://forums.asp.net ).  The experts there will be able to assist you better.  The site is up and running.  If you are having a problem connecting then please try a different browser or machine.
    • Marked as answer by Just Karl Friday, May 29, 2015 4:06 PM
    Tuesday, May 19, 2015 2:15 PM

All replies

  • Hi, 

    The right forum to discuss this case is http://forums.asp.net/, here you can discuss C# code related issue in specific.

    Thank you.


    Fouad Roumieh

    • Proposed as answer by Just Karl Wednesday, May 20, 2015 3:15 PM
    • Marked as answer by Just Karl Friday, May 29, 2015 4:05 PM
    Tuesday, May 19, 2015 10:59 AM
  • unable to open a new thread in this forum.

    help me out.

    Tuesday, May 19, 2015 11:22 AM
  • What do you mean unable? You should register or use microsoft account to login.

    Fouad Roumieh

    Tuesday, May 19, 2015 11:23 AM
  • i used my microsoft account to login, but unable to login into the asp forum page.
    Tuesday, May 19, 2015 11:33 AM
  • Are you able to access the below page, after login:

    http://forums.asp.net/18.aspx/1?Web+Forms

    If yes click on Start New Thread button and post your question.


    Fouad Roumieh

    Tuesday, May 19, 2015 11:36 AM
  • Yes, i did

    i logged in

    But now it is showing as Site is down for maintenance.

    Tuesday, May 19, 2015 12:31 PM
  • Can't i get that answer in this forum only. please
    Tuesday, May 19, 2015 12:39 PM
  • I'm not preventing, from my side I have now answer, but normally such issues are not discussed here, the right experts for this are there not here and its the same procedure for you.

    But you can wait if any contributor wants to help.


    Fouad Roumieh

    Tuesday, May 19, 2015 12:42 PM
  • Questions related to ASP.NET should be posted in the ASP.NET forums (http://forums.asp.net ).  The experts there will be able to assist you better.  The site is up and running.  If you are having a problem connecting then please try a different browser or machine.
    • Marked as answer by Just Karl Friday, May 29, 2015 4:06 PM
    Tuesday, May 19, 2015 2:15 PM