Page 1 of 1

VL Web - how to use video control(PRIM_VDEO)

Posted: Thu Jun 16, 2016 12:41 pm
by Rieko Saitoh
Hi,

In the VL Web, I would like to use video control(PRIM_VDEO).
However, I do not know how to use this. (For example, specifying the file name. etc.)
Does anyone have the sample code of video control(PRIM_VDEO)?

Thank you.

Best regards,
Rieko Saitoh
LANSA japan

Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Thu Jun 16, 2016 3:13 pm
by Stewart Marshall
Hi Rieko

You need only set the Filename property.

All paths are relative to the location of the Partition webfolder - [Installation Root]\x_win95\x_lansa \x_ppp\web\vl

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Height(513) Width(969) Theme(#SYS_THEME<2015Blue>)

Define_Com Class(#PRIM_VDEO) Name(#Video1) Displayposition(1) Left(96) Parent(#COM_OWNER) Tabposition(1) Top(37) Height(404) Width(801)

Evtroutine Handling(#COM_OWNER.Click)
#Video1.FileName := "video.mp4"
Endroutine

End_Com


Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Fri Jun 17, 2016 12:45 pm
by Rieko Saitoh
Hi Stewart,

Thank you very much for your sample code.
I tried it, but can't play the movie file.
The movie file is put in the Partition webfolder.
Is other setting for the file necessary?

Thank you.

Best regards,
Rieko Saitoh
LANSA japan

Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Fri Jun 17, 2016 2:23 pm
by Stewart Marshall
Hi Rieko

The VL video control is little more than a very simple wrapper around the HTML <Video> element.

It is therefore limited to the file formats and features as specified

http://www.w3schools.com/tags/tag_video.asp

Regards

Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Fri Jun 17, 2016 3:28 pm
by Rieko Saitoh
Hi Stewart,

I could play the movie file!
Your advice is quite correct.
The cause is the size of the file. I have specified the very large size file (1904627KB!!).
Therefore it has taken long time for playing the movie.
I'm sorry to trouble you. I appreciate your help!!

Thank you.

Best regards,
Rieko Saitoh
LANSA japan

Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Tue Jun 14, 2022 1:31 am
by adale
I have the prim_vdeo componet working to play a sample video in a web page.
I would like to have the video automatically play when the page is loaded.
The parm "Autoplay" by definition would seem to be the parm to use, but my sample video still will not autoplay with this parm set to True.
What other parm, or evtroutine, should I use to get the video to autoplay?

EVTROUTINE Handling(#Com_owner.Initialize)
#Video1.FileName := "SampleVideo.mp4"
SET Com(#Video1) Autoplay(True)
ENDROUTINE

Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Tue Jun 14, 2022 1:42 pm
by BrendanB
Alan,

the trick (at least for Chrome and New Edge) is:

Code: Select all

Evtroutine Handling(#Com_owner.Initialize)

#Video1.FileName := '/Images/Portalize Demo.mp4'
#Video1.Volume := 0
#Video1.Autoplay := True

Endroutine

With the Important part being:
#Video1.Volume := 0

Chrome and New Edge *WILL NOT* Autoplay videos when the volume is GREATER THAN ZERO -- this is to make it 'less intrusive' on the user.

Setting the volume to zero works to autoplay.

NOTE: Changing the volume PROGRAMATICALLY (after playback starts) *WILL CAUSE* the browser to stop playing the video.

Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Tue Jun 14, 2022 9:40 pm
by adale
Brendan,
That was the trick.
I didn't think about that, but it certainly makes sense.
Thanks,
Arlyn

Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Thu Jun 23, 2022 9:43 pm
by adale
As per Stewarts comment:
"The VL video control is little more than a very simple wrapper around the HTML <Video> element."
One of the html attributes is "Poster" to load an image while the video downloads.
Looking in the properties for PRIM_VDEO, I do not see a 'Poster' property?
Am I just missing it (V15, epc 150040)?

Re: VL Web - how to use video control(PRIM_VDEO)

Posted: Fri Jun 24, 2022 12:21 pm
by BrendanB
Arlyn,

it looks like the attribute 'Poster' is not exposed as a property.

This leaves you with 2 options:

1. Show an image "over the top" of the video control -- hide the image on #Video1.LoadedData

Code: Select all

Evtroutine Handling(#Video1.LoadedData)

#PosterImage.Visible := False

Endroutine
2. Write a widget that either:
a. Implements your own HTML <Video> element (this allows you to expose whatever properties you wish to use).
b. Simply searches for the Video element in the current document and sets the 'poster' attribute.

I would suggest that if you are considering a Widget: it is better to implement your own control, since there is no guarantee that future versions of LANSA will continue to be a wrapper around the HTML <Video> element, and so locating it and setting attributes may stop working...

By far the simplest would be to show an image and just set the visibility to False WHEN the video is loaded.

The Preload may help to load the video faster.