YAFLogo

BWG
  • BWG
  • 100% (Exalted)
  • YAF Lover Topic Starter
2 months ago
I've tried the existing BBCode options in 3.2.7 but can't get Cloudflare videos to display and play in messages. The direct url format is something like:

​https://customer-xxxxxxxxxx.cloudflarestream.com/872ef1e79429b97b9f4f8ae595dd474a/watch

If I post a valid url directly into a browser it will display and play the video. However, none of the BBCode options seem to support this.

Thanks

BWG

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
2 months ago
You can create a custom bbcode for it via the bbcode extension.  I will add support via the media bbcode in the next update. If you compile the source yourself you only need to update the oembed.core nuget package.
BWG
  • BWG
  • 100% (Exalted)
  • YAF Lover Topic Starter
2 months ago
I've created a Custom BBCode through the YafBBCode Extensions UI. It is:

Source RegEx:

​\[cfvideo\](?<inner>.+?)\[/cfvideo\]

Replace RegEx

(This is the embed code CF provides, with ${inner} being the url of the video.

​<div style="position: relative; padding-top: 56.25%;">
  <iframe
    src="${inner}/iframe?poster=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    loading="lazy"
    style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
    allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
    allowfullscreen="true"
  ></iframe>
</div>

So the tag is something like:

​[cfvideo]https://customerxxxxxxxxxxxxxxxxxxxxxxxxxxx/watch[/cfvideo]

This seems to work ok on 3.2.7, but please feel free to edit or delete if you think it could be misleading or problematic in any way for users.