text media items including image tags

Asked by riondluz

This is probably a silly question, but from the forums and looking at client-side xlf files I get the impression that
"text" mediaItems are designed to be "text only" (is this what the <raw> tag is for?). That despite being able to
edit in 'source' mode and add any kind of markup (like <img>) the client is not designed to handle anything other
than text (and its attribs).

That said, when I added an image tag, it rendered just fine in the designers' preview on the server, but failed
to render on the (python) client.
FWIW, i tried both <img src="/path/to/image"> and <img src="http://host/path/to/image">
Sadly, neither URI seemed to work, either with jpg or png.

A bit later, I decided to add a few cmds prior to running the client
I know its unrelated but my startup process (from upstart on tty4 doing an xinit using a custom xorg.conf
which in turn launches the users .xinitrc and xibo proper):
below is in .xinitrc
# lets manually remove stale cache and log files
rm -f /opt/xibo/data/M*.html
rm -f $INITRC_LOG
rm -f /var/log/xibo.LCDtv-full.log
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session /opt/xibo/run.LCDtv-full.sh >> $INITRC_LOG 2>&1
exec chvt 10

Well, after adding the rm cmds the xibo client is now rendering the images contained in the text mediaItems.
Go figure. Can you tell me if what I'm doing with that mediaItem conforms to its design/purpose.
I suppose I could use the embeded MediaType but it seems like overkill for just an image.
Is it possible that flushing cache files made the difference?

TIA
riondluz

P.S.

I spend a considerable amount of time on 'answers' and 'questions'..... and I really wish people would stick to the
correct semantics.
For Example:
"If you put a text box on a layout" really should say "If you put a text mediaItem into a region of a layout.."

I know its a stupid complaint, but sheesh, if the devs don't use semantics correctly, how can one expect
endusers to do so?

Keep up the great work!
RD

Question information

Language:
English Edit question
Status:
Solved
For:
Xibo Edit question
Assignee:
No assignee Edit question
Solved by:
riondluz
Solved:
Last query:
Last reply:
Revision history for this message
Dan Garner (dangarner) said :
#1

Please try to be a little more understanding. Xibo has been written and is supported entirely in our free time, of which we have little. We'd love to spend 4 hours a day on "Answers", but we can't afford it.

Text items in Xibo were never initially designed to host images or other kinds of media - mainly because we consider text something that we wanted to be "offline safe". Therefore the text is cached on the client and remains available in the event of a network outage.

As you have intimated there is some wiggle room because text is actually rendered as HTML - as this was by far the easiest way of getting desirable formatting. Therefore you can include any HTML tag and have that tag pushed through to the client.

In actual fact, text and embedded are handled in virtually the same way.

So yes, you can do it and no its not intended.

As for why clearing the cache files made a difference... I'm not sure. In the windows client the HTML cache is re-generated each time... but perhaps the Python client is doing some caching.

Revision history for this message
riondluz (riondluz) said :
#2

Thanks Dan, I wasn't trying to sound critical. Far from it; only sayin that it doesn't take much to use terms uniformly; specially if xibo has a long and bright future ahead.

As far as text mediaItems (or mediaTypes) are concerned - from what i can see the included image(s) also get cached.

Revision history for this message
Dan Garner (dangarner) said :
#3

Well, the only caching that would occur locally on the client would be the web engine cache of the resource - in the case of the Python client it is rather "over zealous" with caching and may keep hold of the image when it shouldn't.

I don't think you can really rely on the browser cache, at some point (uncontrolled) it will expire and then you will be missing an image.

We have left the XLF spec open for adding extra information to the RAW nodes you saw. At some point we might extend these to reference other resources (so you could put [xiboimage] tags in things, for example).