BBCode [flash] tag deprecation?

feedback, comments and suggestions pertaining to the stardot forum
Post Reply
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

BBCode [flash] tag deprecation?

Post by lurkio »

I've noticed that Youtube videos that have been embedded with the [flash] tag in BBCode in forum threads no longer seem to be displayed in certain browsers -- I've noticed the effect mainly on Apple devices, but perhaps it affects browsers on other devices and OSes too?

I'm guessing it's a consequence of Adobe no longer supporting Flash plugins?

Is there any sort of workaround for the problem (apart from the custom Tampermonkey script I've hacked up)?

:?:
User avatar
BigEd
Posts: 6261
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: BBCode [flash] tag deprecation?

Post by BigEd »

It's been years, I think, since Chrome has stopped responding to those tags.

It might be that a clever person with time and energy could update the forum so we don't see more of those tags, and also update the database to change existing tags into youtube links. But it's very likely that this won't happen...

Can you link to an example post which no longer works as intended?

I suspect a javascript bookmarklet could do the rewriting job. I use bookmarklets for a few purposes. (They are not so easy to use on phones and tablets, as I recall.)
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: BBCode [flash] tag deprecation?

Post by lurkio »

BigEd wrote: Sun Mar 13, 2022 8:35 am It's been years, I think, since Chrome has stopped responding to those tags.
Oh! I didn’t realise that. I hardly use Chrome. I mainly use Safari on macOS and iOS, and it was only within the last few months that I noticed the embedded videos didn’t work. But my understanding is that they might still work in (some?) browsers on (some versions of?) Android..?

BigEd wrote: Sun Mar 13, 2022 8:35 am Can you link to an example post which no longer works as intended?
E.g. all the embedded videos in the Samurai Lantern thread — none of them are displayed in the latest versions of Safari on macOS or iOS:

viewtopic.php?f=53&t=23464

Same goes for all the embedded videos in the “Remarkable videos” thread:

viewtopic.php?p=189118#p189118

BigEd wrote: Sun Mar 13, 2022 8:35 am I suspect a javascript bookmarklet could do the rewriting job. I use bookmarklets for a few purposes. (They are not so easy to use on phones and tablets, as I recall.)
On iOS and iPadOS (and macOS) you can now use browser extensions such as Userscripts or Hyperweb (or Tampermonkey) to automatically inject Greasemonkey-format JavaScript scripts into webpages. Here’s a beta version of one that re-enables the embedded videos on Stardot:

Code: Select all

// ==UserScript==
// @name         Stardot YouTube video embedder
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Replace the phpBB flash tag with an iframe for YouTube
// @author       You
// @match        https://stardot.org.uk/forums/viewtopic.php*
// @icon         https://www.google.com/s2/favicons?domain=stardot.org.uk
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var arr = document.getElementsByName("movie");
    for (var i=0; i<arr.length; i++)
    {
        //console.log(arr[i].value);

        const reg = /(http(?:s)?:\/\/(?:(?:www\.)|(?:m\.))?youtube\.com\/v\/[^&?]+)/ig;
        const str = arr[i].value;
        var array = [...str.matchAll(reg)];
        //console.log(array[0][1]);
        var url = array[0][1];

        if (typeof url !== "undefined")
        {
            url = url.replace(/^http:\/\//,"https://");
            
            const regexp = /[&?]t=((\d+)h)?((\d+)m)?((\d+)(?:s)?)?/ig;
            array = [...str.matchAll(regexp)];
            //console.log(array[0]);

            var h = 0, m=0, s=0;
            if (typeof array[0] !== "undefined" )
            {
                if (typeof (array[0][2]) !== "undefined") { h=60*60*parseInt(array[0][2]); }
                //console.log(h);
                if (typeof (array[0][4]) !== "undefined") { m=60*parseInt(array[0][4]); }
                //console.log(m);
                if (typeof (array[0][6]) !== "undefined") { s=parseInt(array[0][6]); }
                //console.log(s);
            }

            if ((h+m+s)>0) { url = url + "?start="+(h+m+s).toString(); }
            //console.log(url);

            var ht=315, wd=420;
            if (typeof arr[i].parentNode.height !== "undefined") { ht = arr[i].parentNode.height; }
            if (typeof arr[i].parentNode.width !== "undefined") { wd = arr[i].parentNode.width; }
            //console.log(arr[i].parentNode); console.log(ht); console.log(wd);

            var iframe = "<iframe width='"+wd.toString()+"' height='"+ht.toString()+"' allow='fullscreen;' src='"+url.replace("/v/","/embed/")+"'></iframe>";
            //console.log(iframe);
            arr[i].parentNode.insertAdjacentHTML("afterend",iframe);
            arr[i].parentNode.hidden=true;
        }
    }
})();
:idea:
Last edited by lurkio on Thu Oct 20, 2022 9:19 pm, edited 2 times in total.
User avatar
BigEd
Posts: 6261
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: BBCode [flash] tag deprecation?

Post by BigEd »

OK, it would certainly be possible to write a bookmarklet for that...

The tags in question look like this

Code: Select all

[flash=320,256]https://www.youtube.com/v/xhrHV_DUi8w[/flash]
and for me in an older Safari that shows as an image with a clickable red youtube play button. It plays in-place.

Whereas in Chrome it shows as a blue-underlined link which (correctly) points to youtube.

A suitable rewrite might be

Code: Select all

[url=https://www.youtube.com/watch?v=xhrHV_DUi8w][img]https://i.ytimg.com/vi/xhrHV_DUi8w/hqdefault.jpg[/img][/url]
which looks like this on the page:
Image

It's clickable and an image but it's not an embedded player.

This would be an embedded player:

Code: Select all

<iframe width="560" height="315" src="https://www.youtube.com/embed/xhrHV_DUi8w" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
if we could do that. Again, a bookmarklet could do it.

Or, the forum admins could, probably, if they wished, define a suitable BBCode which plonks that HTML into the output. But that's a forum customisation, which is not, I think, felt to be a great thing. Here's how:
Screen Shot 2022-03-13 at 14.14.01.png
Post Reply

Return to “stardot FORUM”