Results 1 to 9 of 9

Thread: Media Player

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    255

    Media Player

    OK ... got the image thing in a datagrid down. Now .. trying to embed a vidio player into the app. They have training pieces they need their salespeople to view. Was looking at Shockwave player, but figured Windows Media Player might be better. How to I grab that class and consume it?

    gollnick
    William E Gollnick

  2. #2
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Media Player

    look at the WMP10 SDK

    I have done this before and is not difficult.

    look at the docs but pretty much this is what you need:

    Code:
    <OBJECT id="Player" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" VIEWASTEXT>
    										<PARAM NAME="URL" VALUE="">
    										<PARAM NAME="rate" VALUE="1">
    										<PARAM NAME="balance" VALUE="0">
    										<PARAM NAME="currentPosition" VALUE="0">
    										<PARAM NAME="defaultFrame" VALUE="">
    										<PARAM NAME="playCount" VALUE="1">
    										<PARAM NAME="autoStart" VALUE="-1">
    										<PARAM NAME="currentMarker" VALUE="0">
    										<PARAM NAME="invokeURLs" VALUE="-1">
    										<PARAM NAME="baseURL" VALUE="">
    										<PARAM NAME="volume" VALUE="50">
    										<PARAM NAME="mute" VALUE="0">
    										<PARAM NAME="uiMode" VALUE="full">
    										<PARAM NAME="stretchToFit" VALUE="0">
    										<PARAM NAME="windowlessVideo" VALUE="0">
    										<PARAM NAME="enabled" VALUE="-1">
    										<PARAM NAME="enableContextMenu" VALUE="-1">
    										<PARAM NAME="fullScreen" VALUE="0">
    										<PARAM NAME="SAMIStyle" VALUE="">
    										<PARAM NAME="SAMILang" VALUE="">
    										<PARAM NAME="SAMIFilename" VALUE="">
    										<PARAM NAME="captioningID" VALUE="">
    										<PARAM NAME="enableErrorDialogs" VALUE="0">
    										<PARAM NAME="_cx" VALUE="6482">
    										<PARAM NAME="_cy" VALUE="6350">
    									</OBJECT>
    the classID is specific to WMP 10

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    255

    Re: Media Player

    Thanks for the fast reply
    Kinda had that. But .. in the ASPX page (code behind) .. how do I change the media url based on a user selection?

    gollnick
    William E Gollnick

  4. #4
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Media Player

    after that object code, add this:

    Code:
    <script>
    		
    										function DoShowFile(theFile)
    										{
    											document.forms[0].Player.URL = theFile;											
    										}
    		
    									</script>
    then in ASP.NET codebehind, when you have chosen the media file, make sure you do a Page.RegisterStartupScript("showMedia", "<script>DoShowFile('" + theSelectedFile + "');</script>");

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    255

    Re: Media Player

    I placed all this within my project. Now .. I removed the line
    <PARAM NAME="URL" VALUE="">
    Was I supposed to? After all I'm replaceing that line with the script
    document.forms[0].Player.URL = theFile;
    which I update with a click event in my form
    Page.RegisterStartupScript("showMedia", "<script>DoShowFile('" + "c:\Run_This\MyFile.mpeg" + "');</script>");

    However .... when I do this I get nothing to play. I know the file is in the correct path (it plays when I do use the <PARAM NAME="URL" VALUE="c:\Run_This\MyFile.mpeg">

    gollnick
    William E Gollnick

  6. #6
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Media Player

    do not remove anything from the stuff I have posted, you need to keep it all there as that could be one of many reasons why it wouldnt be playing the file.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    255

    Re: Media Player

    Techno ... put it back in. Made sure I activated javascripting .... still does not work.


    gollnick
    William E Gollnick

  8. #8
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Media Player

    interesting.
    you do have WMP10 installed, and the SDK? (it should prompt you if you dont have WMP10 installed).
    hmm cant think why it wouldnt work.


    in one of my cells in HTML this is what I have:

    Code:
    <td rowSpan="2">
    									<OBJECT id="Player" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" VIEWASTEXT>
    										<PARAM NAME="URL" VALUE="">
    										<PARAM NAME="rate" VALUE="1">
    										<PARAM NAME="balance" VALUE="0">
    										<PARAM NAME="currentPosition" VALUE="0">
    										<PARAM NAME="defaultFrame" VALUE="">
    										<PARAM NAME="playCount" VALUE="1">
    										<PARAM NAME="autoStart" VALUE="-1">
    										<PARAM NAME="currentMarker" VALUE="0">
    										<PARAM NAME="invokeURLs" VALUE="-1">
    										<PARAM NAME="baseURL" VALUE="">
    										<PARAM NAME="volume" VALUE="50">
    										<PARAM NAME="mute" VALUE="0">
    										<PARAM NAME="uiMode" VALUE="full">
    										<PARAM NAME="stretchToFit" VALUE="0">
    										<PARAM NAME="windowlessVideo" VALUE="0">
    										<PARAM NAME="enabled" VALUE="-1">
    										<PARAM NAME="enableContextMenu" VALUE="-1">
    										<PARAM NAME="fullScreen" VALUE="0">
    										<PARAM NAME="SAMIStyle" VALUE="">
    										<PARAM NAME="SAMILang" VALUE="">
    										<PARAM NAME="SAMIFilename" VALUE="">
    										<PARAM NAME="captioningID" VALUE="">
    										<PARAM NAME="enableErrorDialogs" VALUE="0">
    										<PARAM NAME="_cx" VALUE="6482">
    										<PARAM NAME="_cy" VALUE="6350">
    									</OBJECT>
    									<script>
    		
    										function DoShowFile(theFile)
    										{
    										   document.forms[0].Player.URL = theFile;	
    										}
    		
    									</script>
    </td>

    and as for the selection of the item on ASP.NET:

    Code:
    Page.RegisterStartupScript("showMedia", "<script>DoShowFile('" + theFullPathToFile + "')</script>");

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    255

    Re: Media Player

    Strange I know... If I include my play file within the oroginal parm url .... it plays fine when the form is first shown back from the server.. I just can not plug a new url path into the player

    gollnick
    William E Gollnick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width