Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Playing Videos In Linux Builds - Stumped
Started by roaminggamer Jun 15 2019 09:30 AM

5 replies to this topic
video linux
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

All,
 
TL;DR - I'm looking for help getting videos to display on Linux builds using native.showWebPopup() + HTML File + Video --OR-- A way to cancel/close a video shown with media.*
 
Background To Issue
 
I have been working with a client for a few years who is using Win32 builds for Arcade cabinets.  These builds include a full screen video while the cabinet is idle.
 
Recently, he started a effort to switch to Linux to save on license costs.  Almost everything is working great and we are really happy with the conversion.  However....
 
We are having issues with the video.  Specifically, we have not been able to get it to play.
 
What I Do Now
 
Currently I use 'native.showWebPopup()' to load a HTML file that then loads an MP4 video file and displays it.
 
This is great because we can close the video at any time via the cancelWebPopup() call.  i.e. When users press buttons we skip the video.
 
If you want to see my code, you can see an example of what I am doing here (I will also post key code at the end of this post): 
https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2019/06/videoTest.zip
 
What I Have Tried
 
To get this fixed I've tried:

  • Alternate video codecs: 264, mpeg-4, mpeg-2, theora, 265, vp8.
  • Installing additional support on the Linux system for video etc.
  • media.playVideo() - Plays video, but can't close video early as I need. 

What I Need
I am hoping some here has this working already or has some insights.  I'm basically looking for any help I can get all suggestions are welcome!
 
 
 
Pertinent Code (included in ZIP file above)
 
Call To showWebPopup


local options = { hasBackground=false, baseUrl=system.ResourceDirectory }
native.showWebPopup( left, top, fullw, fullh, "localpage.html", options )

localpage.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Video Test</title>
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<style type="text/css">
body {
background-color:transparent;
}
</style>
</head>

<body>
<video width="1900" height="1060" autoplay>
  <source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

</body>
</html>

 
build.settings

-- For more details on settings see these pages:
--
-- https://docs.coronalabs.com/guide/distribution/buildSettings/index.html
-- https://docs.coronalabs.com/guide/distribution/win32Build/index.html

settings = {
   build = { neverStripDebugInfo = true },
    
    orientation = 
    {
      default    = "landscapeRight",
      supported    = { "landscapeRight", "landscapeLeft" },
    },

   window = {
      defaultMode             = "normal", -- fullscreen, maximized, normal
      resizable                = true,
      enableCloseButton       = true,
      enableMaximizeButton    = true,
      suspendWhenMinimized    = false,

      defaultViewWidth          = 960,  
      defaultViewHeight       = 540,  
      minViewWidth             = 480,  
      minViewHeight            = 270,  

      titleText = {
         default       = "Rowdy Raccoons",
      },
   },
}



[TOPIC: post.html]
#2

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 480 posts
  • Corona SDK

If you open that video file directly in a browser on that same device, does it play?

[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,594 posts
  • Corona SDK

That is a good question.  I'll ask my client.  We are separated geographically so he has to do the 'on final hardware' testing.



[TOPIC: post.html]
#4

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 480 posts
  • Corona SDK

I'd guess that you need to install the win32 codecs. They're not generally includes by default with gnu distributions because of their proprietary licenses, but all distributions include them in the repo for installation.

[TOPIC: post.html]
#5

glitchbit01

[GLOBAL: userInfoPane.html]
glitchbit01
  • Observer

  • 13 posts
  • Corona SDK

Thank Richard.

 

No luck with the installation of the win32 codecs, any other suggestions or thoughts?



[TOPIC: post.html]
#6

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 480 posts
  • Corona SDK

Hmm. Could it be the baseUrl=system.ResourceDirectory that's not working? Perhaps worth some debug prints to see where that actually points to, and then checking that the user which this app is running as has access perms there. Access perms on Linux can be tricky for people more used to Windows because softwares take on the access perms of the user running them, unlike Windows where everything is installed under an admin role. It can be particularly complex with SELinux based distributions. https://selinuxproject.org/page/Main_Page

Could also be a Corona bug. Linux support is still beta I believe, and I recall having trouble with earlier HTML5 support where some of these resource directories returned null instead of actual paths.
  • glitchbit01 likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: video, linux