VL Web - how to use video control(PRIM_VDEO)

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Rieko Saitoh
Posts: 58
Joined: Sat Apr 30, 2016 11:46 am

VL Web - how to use video control(PRIM_VDEO)

Post 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
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

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

Post 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

Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Rieko Saitoh
Posts: 58
Joined: Sat Apr 30, 2016 11:46 am

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

Post 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
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

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

Post 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
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Rieko Saitoh
Posts: 58
Joined: Sat Apr 30, 2016 11:46 am

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

Post 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
adale
Posts: 212
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

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

Post 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
Arlyn Dale
Servias LLC
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

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

Post 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.
adale
Posts: 212
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

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

Post by adale »

Brendan,
That was the trick.
I didn't think about that, but it certainly makes sense.
Thanks,
Arlyn
Arlyn Dale
Servias LLC
adale
Posts: 212
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

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

Post 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)?
Arlyn Dale
Servias LLC
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

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

Post 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.
Post Reply