Re: The semantics of mediaobject
Richard Hamilton <[email protected]> Wed, 5 Apr 2023 22:59:34 -0600
| Newsgroups | gmane.text.docbook.misc |
|---|---|
| Message-ID | <[email protected]> |
I agree with Bob=E2=80=99s point. There=E2=80=99s no reason you can=E2=80=99= t transform into a format for software that can handle multiple formats = and let the rendering software figure out what to do. In fact, that already happens in the XSL 1.0 version of the stylesheets. = If you have a mediaobject that contains an image or video, and you = include a <textobject> that contains a <phrase>, the contents of the = phrase are used as alternate text in the html. I use that all the time = (thanks for implementing that, Bob). If the browser decides there=E2=80=99s a good reason to render both at = the same time (e.g., having a button that lets you display the alt text = over or next to an image), that seems reasonable to me. That said, it might be good to adjust the description of mediaobject to = not be so definite in its ruling out of the option. I also wonder whether the use of <textobject><phrase> for alt text = should be made an official part of the specification. Dick ------- XML Press XML for Technical Communicators http://xmlpress.net [email protected] > On Apr 5, 2023, at 14:00, Bob Stayton <[email protected]> wrote: >=20 > It seems ok to me. The idea of a mediaobject is to contain markup for = one or more versions of the same content. Presenting more than one of = those to the end user would be redundant and annoying. If you consider = the whole rendering system to be the transformation from DocBook to = HTML5 *and* the browser rendering of that HTML5, then your use case does = not seem to violate the description because the consumer of the content = sees only one version, right? >=20 > Bob >=20 > On 4/5/2023 9:27 AM, Norm Tovey-Walsh wrote: >> Hello world, >>=20 >> The description of mediaobject states: >>=20 >> This element contains a set of alternative =E2=80=9Cmedia = objects.=E2=80=9D Exactly >> one object will be selected and rendered. =E2=80=A6 Under no = circumstances >> should more than one object in a mediaobject be used or presented = at >> the same time. >>=20 >> Bearing in mind that this markup was invented 15 or 20 years ago, = long >> before any (widely used) web browser offered anything sophisticated = in >> the way of fallback, we anticipated that markup like this: >>=20 >> <mediaobject> >> <videoobject>=E2=80=A6</videoobject> >> <imageobject>=E2=80=A6</imageobject> >> <textobject>=E2=80=A6</textobject> >> </mediaobject> >>=20 >> would be intepreted along the following lines: =E2=80=9C=E2=80=A6 a = mediaobject might >> contain a video, a high-resolution image, a low-resolution image, a = long >> text description, and a short text description. In a =E2=80=98high-end=E2= =80=99 online >> system, the video is used. For print publishing, the high-resolution >> image is used. For other online systems, either the high- or the >> low-resolution image is used, possibly including the short text >> description as the online alternative. In a text-only environment, >> either the long or the short text description is used.=E2=80=9D >>=20 >> <aside>I observe that =E2=80=9Cpossibly including the short text=E2=80=9D= is, by a very >> narrow reading, a violation of the semantics we=E2=80=99ve already >> asserted.</aside> >>=20 >> Starting in V5.1 we allow more than one *data element in a *object >> element[1] with the semantics that the downstream processor will pick >> one. So now you can do: >>=20 >> <mediaobject> >> <videoobject> >> <videodata type=3D"video/mp4" =E2=80=A6/> >> <videodata type=3D"video/webm" =E2=80=A6/> >> </videoobject> >> <imageobject>=E2=80=A6</imageobject> >> <textobject>=E2=80=A6</textobject> >> </mediaobject> >>=20 >> And let the browser decide whether it wants to render MP4 or WebM. >>=20 >> Trouble is, you can=E2=80=99t put imagedata in the videoobject = wrapper, so >> there=E2=80=99s no way to fallback to a still image. We could fix = this by >> changing videoobject (and audioobject) to allow imageobject, but at = that >> point, we might as well do away with the various flavors and just = have >> one wrapper. (That=E2=80=99s probably what we=E2=80=99d do today, if = we were starting >> over.) >>=20 >> Rather than make the markup even more complicated, I=E2=80=99m = tempted to squint >> really hard at the semantics and try to persuade you that selecting >> multiple objects from the same mediaobject is not a violation of the >> semantics if the rendering system will only render one of them. >>=20 >> In other words, I want a license to cheat and say that I can render = that >> example above in HTML5 as a video element containing three sources, = two >> videos and an image. What say you? >>=20 >> Be seeing you, >> norm >>=20 >> [1] But the content model of imageobject weirdly forbids you from = mixing >> SVG and MathML and other formats. What is that about? >>=20 >> -- >> Norm Tovey-Walsh=20 >> <[email protected]> >> https://norm.tovey-walsh.com/ >>=20 >>=20 >>=20 >>> Advancement is powered by the dynamic interaction of theory and >>> practice. >>>=20