Faceți căutări pe acest blog

Se afișează postările cu eticheta VLC. Afișați toate postările
Se afișează postările cu eticheta VLC. Afișați toate postările

marți, 18 august 2015

Using Videolan (VLC) ActiveX to play stream media (2)

VLC media player offers two ActiveX.
The second version, is the recommended one, and is more powerful and flexible, yet is still very easy to be used.

Here is the same problem, solved with the second ActiveX.
In addition, by pressing SPACE the song is toggled between pause and play.

*************
* Begin code
*************
PUBLIC oform
oform=CREATEOBJECT("myform")
oform.Show

DEFINE CLASS myform AS form
    Height = 600
    Width = 850
    keypreview = .T. && to allow to your form to intercept the keyboard activity
    ADD OBJECT cmd as commandbutton WITH autosize = .T., caption = 'Click and Play'
    ADD OBJECT vlc AS olecontrol WITH top = 50, Height = 600, Width = 800, OleClass = "VideoLAN.VLCPlugin.2"
    PROCEDURE cmd.Click
        lnId = ThisForm.vlc.OBJECT.playlist.add("https://www.youtube.com/watch?v=-1lj0mZDrIw")
        ThisForm.vlc.OBJECT.playlist.play()

        ThisForm.vlc.SetFocus()
    ENDPROC
    PROCEDURE keypress
        LPARAMETERS nkey,nshift
        IF nkey = 32 && when SPACE is pressed
            This.vlc.OBJECT.playlist.togglePause && toggles between pause and play
        ENDIF
    ENDPROC
ENDDEFINE
*************
* End code
*************


https://wiki.videolan.org/Documentation:WebPlugin/

Related posts
http://praisachion.blogspot.com/2015/08/using-videolan-vlc-activex-to-play_18.html
http://praisachion.blogspot.com/2015/08/using-videolan-vlc-activex-to-play.html

Using Videolan (VLC) ActiveX to play stream media

It's enough to use two methods :
- addTarget
- play

addTarget has 4 parameters.
- uri as String
- options as String
- mode as VLCPlayListMod
- Position as Long

First parameters contains the URL, second can be Null (see the third link below for more details), third can be 8 (see the second link below for more details), and fourth can be 0
See the first link below for more details.

Here is the code
*************
* Begin code
*************
PUBLIC oform
oform=CREATEOBJECT("myform")
oform.Show

DEFINE CLASS myform AS form
    Height = 600
    Width = 850
    ADD OBJECT cmd as commandbutton WITH autosize = .T., caption = 'Click and Play'
    ADD OBJECT vlc AS olecontrol WITH top = 50, Height = 600, Width = 800, OleClass = "VideoLAN.VLCPlugin.1"
    PROCEDURE cmd.Click
        ThisForm.vlc.OBJECT.addTarget("https://www.youtube.com/watch?v=-1lj0mZDrIw",,8,0)
        ThisForm.vlc.oBJECT.play()
    ENDPROC
ENDDEFINE

*************
* End code
*************

https://wiki.videolan.org/ActiveX/
https://wiki.videolan.org/VLCPlaylistMode/
https://wiki.videolan.org/VLC_command-line_help

VLC media player is a free and open source utility. Reliable and has no need for decoders.
http://www.videolan.org/ 

Related posts
http://praisachion.blogspot.com/2015/08/using-videolan-vlc-activex-to-play_18.html
http://praisachion.blogspot.com/2015/08/using-videolan-vlc-activex-to-play.html