UI::HtmlDialog not playing MP4 video, UI::WebDialog does

video
webdialog
ui::webdialog
html
ui::htmldialog
#1

I am trying to play a MP4 video in HTML with UI::HtmlDialog using the HTML5 standard way to embed it:

<video width="1280" height="720" controls>
  <source src="movie.mp4" type="video/mp4">
</video>

The video is not embedded properly, and I have to convert it to .ogg to make it work. This was working correctly with the deprecated UI::WebDialog, so I guess there is any problem either with the codecs or with the HTML5 usage.

0 Likes

#2

the codex is most likely fine…

HtmlDialog uses CEF [Chrome Embedded Framework] so new rules apply…

video tag changes on chrome

john

0 Likes

#3

Why not switch to using OGG? OGG is an open format that is freely redistributable, MP4 is not. If license types (free/non-free) are a limitation that is relevant for your use case, this should be motivation enough to support the side that works for you.

Apparently Chromium Embedded (CEF) needs to be compiled with include proprietary codecs.
We don’t know whether SketchUp compiled CEF with that option or not.

1 Like

#4

@Aerilius eventually I will need to use OGG to deal with license types, that is why I am already converting some videos. But internally I save a lot of time by using MP4 for now.

It also seems to me that you point to the right issue, probably SketchUp didn’t compile CEF with include proprietary codecs in the new HtmlDialog class.

0 Likes

#5

Can you report an issue with a complete example, including a video demonstrating what you observe?

0 Likes

#6

yeh,

CEF in SU v18 loads an empty player for mp4’s…

drop the mp4 in the zip into Sketchup.temp_dir so that it’s relative to the [not yet created] html, and it won’t play…

add the .ogv and that will play…

anyone of you used ffmpeg2theora windows?

I used brew install ffmpeg2theora on the mac…

it’s very fast but drops the last few frames on this short clips…

@tt_su you know I’m rubbish at putting stuff on github…

dlg = UI::HtmlDialog.new(
	dialog_title:    'local mp4 or ogv?',
	preferences_key: 'com.local.mp4',
	scrollable:       true,
	resizable:        true,
	width:            800,
	height:           450,
	style:            UI::HtmlDialog::STYLE_WINDOW
)

  html = <<-HTML
	<!DOCTYPE html> 
	<html> 
	<body> 
	<video width="400" controls autoplay>
		<source src="pencil.mp4" type="video/mp4" />
		<source src="pencil.ogv" type="video/ogg" />
	</video>
	</body> 
	</html>
	HTML

  dlg.set_html(html)
  dlg.center
  dlg.show

pencil.zip (28.2 KB)

0 Likes

#7

clippy

“Looks like you are trying to log an issue!”

3 Likes

#8

We need to hack together a discourse bot for that!

1 Like

#9

The deprecated dialog uses OS provided browser and proprietary video codecs, while the shipped Chromium-based dialog does not. However with HtmlDialog, we can guarantee the consistency of video codecs you will find in SketchUp.

3 Likes

#10

So these codecs are the default ones from Chromium? And Chrome itself provides an extended set? Or does that also tap into system installed codecs?

0 Likes

#11

The embedded chrome has this fixed set, on both platforms. It does not reach for proprietary codec’s that may exist within the operating system.

0 Likes