We’re in the visual and interactive content era. It’s becoming increasingly more and more prominent. Take a look at digital community statistics and you’ll discover that YouTube is the second most popular social network.
At some point, most web developers want to include videos in their sites and coincidentally, databases frequently contain links to videos (either hosted locally or on the web). This post shows you two ways to include videos in your 4D applications.
Use an external player
One option is to open your videos with an external player. With the OPEN URL command, the video will be opened in the operating system’s default player.
OPEN URL(".../myVideo.mp4")
Play video in your forms
But you may want play your videos internally, i.e. within your 4D application forms. So why not use an HTML player in a web area with the WA OPEN URL command instead?
C_TEXT($htmlPath;$html)
$html:="<html><body>"
$html:=$html+"<video width=\"400\"controls>"
$html:=$html+"<source src=\"myVideo.mp4\" type=\"video/mp4\">"
$html:=$html+"Your browser does not support HTML5 video."
$html:=$html+"</video>"
$html:=$html+"</body></html>"
$htmlPath:=Temporary folder+"myHTML.html"
TEXT TO DOCUMENT($htmlPath;$html)
WA OPEN URL(*;"Web Area";$htmlPath)
More information about the HTML player can be found on the w3schools web site.