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.
the codex is most likely fine…
HtmlDialog uses CEF [Chrome Embedded Framework] so new rules apply…
video tag changes on chrome
john
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
@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.
tt_su
December 12, 2018, 1:10pm
5
Can you report an issue with a complete example, including a video demonstrating what you observe?
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)
tt_su
December 13, 2018, 11:50am
7
“Looks like you are trying to log an issue!”
opened 11:47AM - 13 Dec 18 UTC
closed 04:51PM - 31 Jan 19 UTC
bug
wontfix
Ruby API
SketchUp
logged
Reference forum thread: https://forums.sketchup.com/t/ui-htmldialog-not-playing-… mp4-video-ui-webdialog-does/83255
> I am trying to play a MP4 video in HTML with [UI::HtmlDialog](http://ruby.sketchup.com/UI/HtmlDialog.html) 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](http://ruby.sketchup.com/UI/WebDialog.html), so I guess there is any problem either with the codecs or with the HTML5 usage.
> 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…
```ruby
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](https://github.com/SketchUp/api-issue-tracker/files/2675809/pencil.zip)
3 Likes
We need to hack together a discourse bot for that!
1 Like
Nick_G
December 13, 2018, 2:08pm
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
tt_su
December 17, 2018, 3:38pm
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?
Nick_G
December 17, 2018, 4:13pm
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.