Results 1 to 4 of 4
  1. #1
    Miles R is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    49

    Using Windows Media Player in Access Form.

    I have added Windows Media Player 9 Active X to one of my Access 2007 forms to play video files.


    Have just about managed to get it to work, but there is a show stopper. The size of the video keeps changing.
    I have code
    With Me.WindowsMediaPlayer9
    .stretchToFit = True
    ' .currentPlaylist.Clear
    .Width = 10521
    .Height = 7014
    .Top = 3312
    .Left = 6480
    .settings.volume = 100
    .Object.Controls.play
    End With

    before each call to show the Video file.

    The Height is always correct, but on each alternate call, the width changes between the correct width and about 1/3 the width. Can't fathom
    what is causing this. The .wmv file is always the same one, so it is not different files.

    Another less important issue is that in the WMP it shows Playlist xxx, where xxx increments on each call. Playlist is irrelevant to me, so just want this
    to be blank or some default value.

    I know this is a long shot, as probably few people use WMP and probably not in Access 2007.

    Would be wonderful if anyone knows how to fix this.

  2. #2
    Miles R is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    49
    Have now sort of fixed the problems.
    The Playlist was fixed by using the method .currentPlaylist.Name = "My text"
    The size problem I fixed using a cludge. After the code in the original post, I have added
    If Me.WindowsMediaPlayer.Width < correctwidth Then
    Me.WindowsMediaPlayer.Width = correctwidth
    End If
    Amazingly this work around fixes it.
    There is still an annoying problem of a black square appearing for a split second near the top of the form (not where the WMP is located).
    This is despite Application.Echo = false until the WMP has been correctly resized.
    May have to live with this one.

  3. #3
    Miles R is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    49

    Smile Solved

    Problem now solved.
    If I make the WMP visible before changing the attributes and setting URL etc, the WMP always starts the correct size without any black box flashes.
    The problem seemed to occur if the .visible = True was set after the attributes had been set.
    Not sure of the reason for that.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,569
    Good of you to post your observations and solutions. Thanks!
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-20-2020, 04:01 PM
  2. Windows media player Add to playlist
    By anchamal in forum Forms
    Replies: 0
    Last Post: 10-09-2013, 06:34 AM
  3. Windows Media Player Control
    By dalematt in forum Forms
    Replies: 1
    Last Post: 11-18-2011, 06:20 PM
  4. windows media player
    By ksmith in forum Programming
    Replies: 3
    Last Post: 09-20-2011, 12:44 PM
  5. Replies: 1
    Last Post: 08-05-2010, 12:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums