How can I toggle fullscreen for the embedded VLC player?

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
rrrrrrrr
Blank Cone
Blank Cone
Posts: 10
Joined: 21 Nov 2015 23:05

How can I toggle fullscreen for the embedded VLC player?

Postby rrrrrrrr » 21 Nov 2015 23:10

I am embedding the VLC media player into a Windows Forms application in VB.NET through an activeX control.
The code goes like this:

Code: Select all

Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Open file button Dim openFileDialog1 As New OpenFileDialog() openFileDialog1.Title = "Open file" If openFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then AxVLCPlugin21.playlist.add(openFileDialog1.FileName) End If openFileDialog1.Dispose() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click 'Play button AxVLCPlugin21.playlist.play() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 'Stop button AxVLCPlugin21.playlist.stop() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'Pause button AxVLCPlugin21.playlist.togglePause() End Sub Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll 'Volume control AxVLCPlugin21.audio.Volume = TrackBar1.Value End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click 'Toggle Full Screen button AxVLCPlugin21.video.toggleFullscreen() End Sub End Class
How can I toggle full screen?

This code makes no effect:

Code: Select all

AxVLCPlugin21.video.toggleFullscreen()
Thank you.

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: How can I toggle fullscreen for the embedded VLC player?

Postby da2424 » 26 Nov 2015 08:40

This is a known limitation in previous releases.
Please try it with a nightly build, then it should work.

rrrrrrrr
Blank Cone
Blank Cone
Posts: 10
Joined: 21 Nov 2015 23:05

Re: How can I toggle fullscreen for the embedded VLC player?

Postby rrrrrrrr » 26 Nov 2015 21:54

Thank you, I will try it.
Is there a list of known limitations somewhere?
Where can I find out about the limitations?
Many functions of the activeX control do not seem to work :(
Is it possible to use nightly build's acteveX in a VB.NET project without installing the nightly build?
How can I do that?

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: How can I toggle fullscreen for the embedded VLC player?

Postby da2424 » 27 Nov 2015 08:09

Is there a list of known limitations somewhere?
There should be no more limitations in the current nightly, only the attribute 'bgcolor' doesn't work currently.
Other known limitations and particularities are described in the documentation: https://wiki.videolan.org/index.php?tit ... :WebPlugin

Many functions of the activeX control do not seem to work :(
Yes, some functions were broken, but should be fixed in current nightlies.

Is it possible to use nightly build's acteveX in a VB.NET project without installing the nightly build?
How can I do that?
Yes, its possible:
Unregister your current ActiveX library:

Code: Select all

regsvr32 /u "C:\Program Files (x86)\VideoLAN\VLC\axvlc.dll"
Then register your nightly build:

Code: Select all

regsvr32 "C:\path\to\nightly\axvlc.dll"

rrrrrrrr
Blank Cone
Blank Cone
Posts: 10
Joined: 21 Nov 2015 23:05

Re: How can I toggle fullscreen for the embedded VLC player?

Postby rrrrrrrr » 27 Nov 2015 15:39

Thank you very much!
I will try it and write back.

rrrrrrrr
Blank Cone
Blank Cone
Posts: 10
Joined: 21 Nov 2015 23:05

Re: How can I toggle fullscreen for the embedded VLC player?

Postby rrrrrrrr » 04 Feb 2016 20:41

I tried to get it working, but with no success.
Here is what I have tried so far:


- Uninstalled all versions of VLC
- Installed vlc-1.1.9-win32.exe
- works in а new project
- toggleFullScreen does not work
- does not load in the old project.
- Uninstalled vlc-1.1.9-win32.exe
- Downloaded the latest nightly build: vlc-2.2.2-win32.exe 2015-12-28 02:45 29M
- Installed vlc-2.2.2-win32.exe
- loads in a new project but does not play
- toggleFullScreen works
- Does not load in the old project
- Uninstalled vlc-2.2.2-win32.exe
- Downloaded a previous nightly build vlc-2.2.2-win32.exe 2015-11-27 02:45 29M
- Installed vlc-2.2.2-win32.exe
- does not load in a new project, crashes VB.NET
- Uninstalled vlc-2.2.2-win32.exe
- Downloaded alpha vlc-2.2.1-win32.exe 13-Apr-2015 14:13 28849904
- Installed vlc-2.2.1-win32.exe
- does not load in a new project
- Uninstalled vlc-2.2.1-win32.exe
- Downloaded alpha vlc-2.2.0-win32.exe 27-Feb-2015 14:54 28509232
- Installed vlc-2.2.0-win32.exe
- does not load in a new project
- Uninstalled vlc-2.2.0-win32.exe
- Downloaded alpha vlc-2.1.5-win32.exe 26-Jul-2014 00:30 24743106
- Installed vlc-2.1.5-win32.exe
- loads in a new project but does not play, also mute is always 'on'
- toggleFullScreen works
- Uninstalled vlc-2.1.5-win32.exe
- Downloaded alpha vlc-2.1.3-win32.exe 05-Feb-2014 01:47 24677393
- loads in a new project but does not play, also mute is always 'on'
- toggleFullScreen works
- Uninstalled vlc-2.1.3-win32.exe
- Downloaded alpha vlc-2.1.2-win32.exe 09-Dec-2013 00:38 24097311
- Installed vlc-2.1.2-win32.exe
- loads in a new project but does not play, also mute is always 'on'
- toggleFullScreen works
- Uninstalled vlc-2.1.2-win32.exe
- Installed vlc-2.1.2-win32.exe without Mozilla plugin - the same effect
- Uninstalled vlc-2.1.2-win32.exe
- Downloaded alpha vlc-2.1.1-win32.exe 11-Nov-2013 19:20 24489269
- Installed vlc-2.1.1-win32.exe
- loads in a new project but does not play, also mute is always 'on'
- toggleFullScreen works
- Uninstalled vlc-2.1.1-win32.exe
- Downloaded alpha vlc-2.1.0-win32.exe 25-Sep-2013 15:42 24278649
- Installed vlc-2.1.0-win32.exe
- loads in a new project but does not play, also mute is always 'on'
- toggleFullScreen works
- Uninstalled vlc-2.1.0-win32.exe
- Installed vlc-1.1.9-win32.exe
- works in а new project
- toggleFullScreen does not work
- Uninstalled vlc-1.1.9-win32.exe
- Downloaded alpha vlc-2.0.0-win32.exe 17-Feb-2012 21:19 22012750
- Installed vlc-2.0.0-win32.exe
- loads in a new project but does not play
- mute can be toggled
- toggleFullScreen works
- Uninstalled vlc-2.0.0-win32.exe
- Downloaded alpha vlc-2.0.5-win32.exe 14-Dec-2012 22:51 22916830
- Installed vlc-2.0.5-win32.exe
- loads in a new project but does not play
- mute can be toggled
- toggleFullScreen works
- Uninstalled vlc-2.0.5-win32.exe
- Again downloaded alpha vlc-2.1.0-win32.exe 25-Sep-2013 15:42 24278649
- Installed vlc-2.1.0-win32.exe without Mozilla plugin
- loads in a new project but does not play, also mute is always 'on'
- toggleFullScreen works
- crashes VB.NET when I close it
- Uninstalled vlc-2.1.0-win32.exe
- Installed vlc-1.1.9-win32.exe

I have Windows 7 Home basic x64,
Microsoft Visual Studio 2010 Version 10.0.30319.1 RTMRel (x32)
Microsoft .NET Framework Version 4.0.30319 RTMRel

Am I doing something wrong? How can I fix it?
Thank you.

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: How can I toggle fullscreen for the embedded VLC player?

Postby da2424 » 05 Feb 2016 16:18

- Downloaded the latest nightly build: vlc-2.2.2-win32.exe 2015-12-28 02:45 29M
- Installed vlc-2.2.2-win32.exe
- loads in a new project but does not play
- toggleFullScreen works
- Does not load in the old project
- Uninstalled vlc-2.2.2-win32.exe
What do you mean mit "does not play"?
For the old project, try to rename the folders /obj and /bin. Then the needed libraries to access VLC will be re-generated for the current version.

rrrrrrrr
Blank Cone
Blank Cone
Posts: 10
Joined: 21 Nov 2015 23:05

Re: How can I toggle fullscreen for the embedded VLC player?

Postby rrrrrrrr » 06 Feb 2016 06:35

Hi, da2424.

Thanks for the advice.
Currently the vlc-1.1.9-win32.exe version works in both new and old projects.
I did not do anything, it just started working.
Unfortunately, toggleFullscreen does not work with this version.

With the "latest nightly build: vlc-2.2.2-win32.exe 2015-12-28 02:45 29M" I tried to run the same test code that I ran with all the other versions:

Code: Select all

Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Open file button Dim openFileDialog1 As New OpenFileDialog() openFileDialog1.Title = "Open file" If openFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then Dim itmm As String = openFileDialog1.FileName PlayItem(itmm) End If openFileDialog1.Dispose() End Sub Private Sub PlayItem(ByVal itmm As String) AxVLCPlugin21.playlist.items.clear() AxVLCPlugin21.playlist.add(itmm) AxVLCPlugin21.playlist.playItem(0) AxVLCPlugin21.playlist.play() MsgBox("Playing " & itmm) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click AxVLCPlugin21.video.toggleFullscreen() End Sub End Class
The media file did not play, that is there was no audio and no video output. There was just a black box. No error messages. Nothing.
The AxVLCPlugin21.playlist.isPlaying returned true.

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: How can I toggle fullscreen for the embedded VLC player?

Postby da2424 » 06 Feb 2016 16:48

VLC does not support Windows paths, but MRLs, like

Code: Select all

file:///c:/test.mp4
It seems that older versions have supported this.

You can convert it to a MRL with this template:

Code: Select all

If openFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then Dim itmm = New System.Uri(OpenFileDialog1.FileName) PlayItem(itmm.AbsoluteUri) End If

rrrrrrrr
Blank Cone
Blank Cone
Posts: 10
Joined: 21 Nov 2015 23:05

Re: How can I toggle fullscreen for the embedded VLC player?

Postby rrrrrrrr » 08 Feb 2016 01:50

Hi, da2424.

That is a crucial piece of information. Thank you.
I did not see that covered anywhere.
I was basing my code on this tutorial http://www.youtube.com/watch?v=M9bZPRaoh7A
The author claimed that he used VLC version 2.1.0, but when I tried that version, the code did not work.
Now I installed again the latest nightly build (vlc-2.2.2-win32.exe, 2015-12-28 02:45) and tried the code with Uri instead of string, and it worked!
ToggleFullScreen also works.

Unfortunately, this version of VLC seems to be a bit buggy: occasionally during playback in the full screen mode the toolbar disappears altogether, and sometimes the playback freezes also, and then it becomes a problem to exit the full screen.

Could you please recommend the latest and the least buggy version of the VLC ActiveX ?

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: How can I toggle fullscreen for the embedded VLC player?

Postby da2424 » 08 Feb 2016 09:08

The problem with the toolbar is a known problem in v2.2.2: https://trac.videolan.org/vlc/ticket/14660
As workaround, you can exit the fullscreen with the ESC key.

I haven't seen playback freezes with v2.2.2 yet. You could try v2.2.1, this version should be fairly stable. But v2.2.2 should be better in the most of points, I think. (e.g. Many bugfixes and improvements)

Mannino
New Cone
New Cone
Posts: 1
Joined: 21 Aug 2016 12:40

Re: How can I toggle fullscreen for the embedded VLC player?

Postby Mannino » 23 Aug 2016 08:04

thanks to the post of " da2424 "
in reading this post I managed to resurrect VLC and Visual Basic 10 by persistent dark. for several days .


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 6 guests