Results 1 to 5 of 5

Thread: media player and set binary data

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    15

    media player and set binary data

    Hi.
    I have a problem.Please can you help me?

    This is runing.
    AxWindowsMediaPlayer1.URL="C:\video.avi"

    But I want to set binary data for media player.
    example,
    Dim dArray() as byte=ReadData("C:\video.avi")
    AxWindowsMediaPlayer1.URL = dArray

    And I can't do. What is the method for read binary data?

    Thanks..

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: media player and set binary data

    You can read the contents of a file into a byte array like this:
    Code:
    Dim byteArray() As Byte = IO.File.ReadAllBytes("C:\video.avi" )
    but I fail to see what do you intend to do after this since AxWindowsMediaPlayer1.URL accepts only a string with supposed file location (UNC or local path), not the file itself.
    I'm afraid that Windows Media Player control cannot work with byte arrays directly.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    15

    Re: media player and set binary data

    @cicatrix thank you for your reply. I've done it. Only string value is valid for url method. But I want to send binary data for this component. Or is different other media player control?(to be valid a binary data method)
    thanks.

  4. #4
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: media player and set binary data

    You should search specifically for a component or control that supports this feature. It cannot be done with Media Player control unless you write the array into a file and provide a file name to it.

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    15

    Re: media player and set binary data

    @cicatrix thanks again. I'm looking for.

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