HTML5 Video Player

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Steve Collins
Posts: 47
Joined: Thu Jan 10, 2008 7:15 am
Location: Redondo Beach, CA
Contact:

HTML5 Video Player

Post by Steve Collins » Thu Feb 18, 2016 5:16 am

I currently use revBrowser to play about 25 different short Flash (swf) videos in a CDROM app. The client hands the CDs out and mails them by the thousands, so compatibility on PC and Mac is crucial. With Flash being removed from many computers, they are worried too many people will no longer be able to play the videos.

I read at https://livecode.com/use-the-web-browser/ that LiveCode can play videos via HTML5 in the onboard browser. Does that mean I can replace the Flash videos with mp4's (supported by both PC and Mac) on the CD and play them through revBrowser? That would be wonderful! If so, before I reinvent the wheel, is there a recommended HTML5 player and LiveCode code starting point for this?

Thanks,
Steve

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: HTML5 Video Player

Post by LCNeil » Thu Feb 18, 2016 10:59 am

Hi Steve,

I don't think this is possible via the potential security concerns of local file access via a web browser. It is possible to play local videos but a user would have to physically select them via a file picker. More information on this here-

http://stackoverflow.com/questions/8885 ... -video-tag

Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--

okk
Posts: 176
Joined: Wed Feb 04, 2015 11:37 am

Re: HTML5 Video Player

Post by okk » Fri Feb 19, 2016 12:26 am

Hi Steve,
why not used the player object? If it is only about simple playback of .mp4 files this would be fairly easy to implement. You probably have to check for the environment (MacOS or Windows) when opening the stack and then treat the playback slightly different depending on the environment. For the MacOS side there should be no problem at all, for Windows look this discussion, although it might be dated knowledge: http://forums.livecode.com/viewtopic.php?f=18&t=7653

Best
Oliver

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: HTML5 Video Player

Post by FourthWorld » Fri Feb 19, 2016 1:24 am

What Oliver said. If you're already sending CDs there's no need to depend on the limitations of a browser. Build a LiveCode standalone and get a better true desktop experience (and with LC's flexibility once you get it set up you'll probably save production costs by being able to make tools that build your content faster than can be done for most web layouts).
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Steve Collins
Posts: 47
Joined: Thu Jan 10, 2008 7:15 am
Location: Redondo Beach, CA
Contact:

Re: HTML5 Video Player

Post by Steve Collins » Fri Feb 19, 2016 2:10 am

I wish! Player objects in LiveCode support only QuickTime videos. Problem is, QT installed based on PCs (95% of computers) is questionable. Some say as QT installed base is as high as 80% or so because iTunes requires it and others think under 50%. For this promotional discs, users won't entertain having to install QT before they can play the videos. Looks like mp4 videos played on HTML5 video players is pretty much universally supported. I have code that does it and just trying to get LC to run it now, which I think is just me needing to figure out how.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: HTML5 Video Player

Post by FourthWorld » Fri Feb 19, 2016 2:15 am

Although LiveCode can be used on older Windows systems that may have QuickTime installed, QuickTime is not required for video playback.

What issues have you run into playing video on Windows without QuickTime?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Steve Collins
Posts: 47
Joined: Thu Jan 10, 2008 7:15 am
Location: Redondo Beach, CA
Contact:

Re: HTML5 Video Player

Post by Steve Collins » Fri Feb 19, 2016 2:39 am

FourthWorld wrote:Although LiveCode can be used on older Windows systems that may have QuickTime installed, QuickTime is not required for video playback.

What issues have you run into playing video on Windows without QuickTime?
I need to play videos in a LC standalone on both Mac and PC, both the standalone and videos are on the same CD. I understood only QT video types could be played by LC, something about not having access to Window's video services to play them. Can I just play an mp4 in LC, positioned and sized where I like, that will run on PC and Mac? That would be wonderful.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: HTML5 Video Player

Post by FourthWorld » Fri Feb 19, 2016 2:55 am

It may depend on the codec used, but give it a try.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: HTML5 Video Player

Post by jacque » Fri Feb 19, 2016 8:28 pm

When I last checked, Windows doesn't ship with a codec for mp4 which is why it requires QT. That may have changed with Windows 10 but users with older versions will still need QT or will need to download and install the codec.

I agree that using a player control is the best alternative but the codec issue is a stickler. One solution might be to create two copies of each video, one in a Mac format and another in Windows native format, and play the correct file based on the current platform. Seems like overkill but it could work.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: HTML5 Video Player

Post by Klaus » Fri Feb 19, 2016 11:05 pm

Hi all,

if you install the LAVfilter package for WIndows, WMP (Windows Media Player) can play MP4 and a lot of other formats!
https://github.com/Nevcairiel/LAVFilters/releases
Give it a try, they are free and work fine! :D

Not sure if this will also work in a browser however.


Best

Klaus

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: HTML5 Video Player

Post by jacque » Sat Feb 20, 2016 6:34 pm

Klaus wrote:if you install the LAVfilter package for WIndows, WMP (Windows Media Player) can play MP4 and a lot of other formats!
Does every user have to install it, or can it be embedded in the app?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Steve Collins
Posts: 47
Joined: Thu Jan 10, 2008 7:15 am
Location: Redondo Beach, CA
Contact:

Re: HTML5 Video Player

Post by Steve Collins » Mon Feb 22, 2016 9:12 am

FourthWorld wrote:It may depend on the codec used, but give it a try.
Tried on Windows 10 with mp4 and wmv. Both play when opened directly in Windows Media Player but neither play in LC. The mp4 does play in LC on the Mac. Must need QuickTime to use Player Object, as I think has been reported and speaks to less directly than is helpful in the manual.

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: HTML5 Video Player

Post by Klaus » Mon Feb 22, 2016 4:18 pm

Hi Jaques,
jacque wrote:
Klaus wrote:if you install the LAVfilter package for WIndows, WMP (Windows Media Player) can play MP4 and a lot of other formats!
Does every user have to install it, or can it be embedded in the app?
it needs to be installed, either by the user or by your/your app.
But it is allowed to bundle it with your app.

Edit:
I fI remember correctly I used to check for the exitstence of this folder, which meant that LAVFilter
have been installed, but that was years ago on Win XP 8)
...
put (there is a folder (specialfolderpath(38) & "/LAV Filters")) into tLAVInstalled
...


Best

Klaus

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: HTML5 Video Player

Post by jacque » Mon Feb 22, 2016 6:09 pm

Steve Collins wrote:Tried on Windows 10 with mp4 and wmv. Both play when opened directly in Windows Media Player but neither play in LC. The mp4 does play in LC on the Mac.
That sounds like Windows has the right codecs installed now. Check the LC prefs and make sure that it isn't trying to load QT on startup. You want to force LC to use native Windows playback. Restart LC before trying again.

Also, to be safe, put this into a startup or preOpenStack handler in the stack:

Code: Select all

set the dontuseQT to true
That will only apply in the standalone, since the IDE manages QT before any stacks load. The default setting is supposed to be off but it won't hurt to add the line anyway.

If you have machines with older versions of Windows installed you should probably check to make sure they also have the right codecs.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Steve Collins
Posts: 47
Joined: Thu Jan 10, 2008 7:15 am
Location: Redondo Beach, CA
Contact:

Re: HTML5 Video Player

Post by Steve Collins » Mon Feb 22, 2016 8:33 pm

jacque wrote:
Steve Collins wrote:Tried on Windows 10 with mp4 and wmv. Both play when opened directly in Windows Media Player but neither play in LC. The mp4 does play in LC on the Mac.
Check the LC prefs and make sure that it isn't trying to load QT on startup.

If you have machines with older versions of Windows installed you should probably check to make sure they also have the right codecs.
It was set to load QT. Will test without...

From what I have read, playing an mp4 in HTML5 is practically universal these days, because it relies on the browser engines to play them and they are all capable these days. I have an HTML5 page I wrote with just a handful of code that does that flawlessly when dropped onto a browser (calls player and file type with direct link to video on hard drive). When loading that page into revBrowserOpenCef, though, only the player loads with what appears to be a broken link icon in it. LC script:

put revBrowserOpenCef(the windowId of this stack, "file:///Users/stevecollins/Desktop/Player/TestHTML5Video.html") into tBrowserID
revBrowserSet tBrowserID, "rect", the rect of graphic "browserPlaceholder"

Neil Rogers posted in November that HTML5 video should play now this way in LC.
https://livecode.com/use-the-web-browser/

I was advised in a LC forum post that calling out a video file to play in a browser is prohibited, for security reasons. I think that is when performing it through an HTTP link that reached out to a remote users hard drive, not when both the page and video are hosted on the hard drive. Browsers can do it, why not LC? I'm concerned calling the page in LC is similar in function to the HTTP call, though, and thus the broken link. Supposedly you can load the video into a cache with HTML5 and reference the video from there, but I'm seriously in over my head trying to figure that out.

Anyone know how to call a HTML5 page that plays a video into LC browser and have it play like it does when dropped onto a browser? That would solve LC video disconnect in a very big way.

Thanks,
Steve

Post Reply

Return to “Multimedia”