vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Embed TikTok (https://vborg.vbsupport.ru/showthread.php?t=327944)

Irishnotsane 04-21-2020 06:43 PM

Embed TikTok
 
Anyone have any idea how I can embed TikTok videos into the forum using BBCode?

I've tried the following code

Code:

<blockquote class="tiktok-embed" cite="https://www.tiktok.com/{param}" style="max-width: 605px;min-width: 325px;" ></blockquote> <script async src="https://www.tiktok.com/embed.js"></script>
However it doesn't work.. Can't figure it out to save my life
Not sure if this will help you, but might as well be a different language to me
https://developers.tiktok.com/doc/Embed

Thanks

PinkMilk 04-21-2020 11:59 PM

1 Attachment(s)
I have it working with:
Code:

<blockquote class="tiktok-embed" data-video-id="{param}" style="max-width: 605px;" > <section></section> </blockquote> <script async src="https://www.tiktok.com/embed.js"></script>

Use {option}
No

Remove Tag If Empty
Yes

Disable BB Code Within This BB Code
Yes

Disable Smilies Within This BB Code
Yes

Disable Word Wrapping Within This BB Code
Yes

Disable Automatic Link Parsing Within This BB Code
Yes

Helpful Tip:

If you have a few TikTok videos embedded on a page/post it loads the embed code
Code:

<script async src="https://www.tiktok.com/embed.js"></script>
for each video which is a waste of time and resources, to load it only once remove it from bbcode replacement and manually add it to SHOWTHREAD template:

Find:
Code:

</head>
Add above:
Code:

<script async src="https://www.tiktok.com/embed.js"></script>
Other Notes:
  • If you do this it won't show in Admincp BB Code Manager page (see attachment) but works fine in posts.
  • Whether you keep script with bbcode or manually add to template videos take a while to load after posting or editing, refreshing page (f5) seems to fix that.

Irishnotsane 04-22-2020 07:30 AM

This is brillaint thanks!!

I don't suppose there is ANYWAY a user would be able to just post in the whole URL instead of the long number?

Probably a long-shot.
But either way, thanks! i did think it was something to do with that data video id, as I was playing around with it for ages after I had posted this, feel like I came close a few times lol

PinkMilk 05-20-2020 07:43 PM

1 Attachment(s)
Quote:

Originally Posted by Irishnotsane (Post 2602638)
This is brillaint thanks!!

I don't suppose there is ANYWAY a user would be able to just post in the whole URL instead of the long number?

Probably a long-shot.
But either way, thanks! i did think it was something to do with that data video id, as I was playing around with it for ages after I had posted this, feel like I came close a few times lol

***** This is seperate to the bbcode above. You do not need to wrap in bbcode tags or even create the bbcode replacement in admincp, just add the tiktok url to your post like you would any other link. *****


This will add video from full URL.
Example:
Code:

https://www.tiktok.com/@simbathewhitegsd/video/6828187262400924933
Note: This is a plugin NOT product!

Admincp > Plugins & Products > Download / Upload Plugins > Import Plugin Definitions XML File

PinkMilk 05-21-2020 05:04 PM

Delete me :(

Irishnotsane 05-21-2020 08:04 PM

wow thanks PinkMilk!

Sadly I can't seem to get this to work
I'm just presented with this:

http://puu.sh/FNfND/e5e58eab9c.jpg

Any ideas?

PinkMilk 05-22-2020 10:44 AM

Quote:

Originally Posted by Irishnotsane (Post 2603019)
wow thanks PinkMilk!

Sadly I can't seem to get this to work
I'm just presented with this:

Any ideas?

Whats the url you used?

Irishnotsane 05-22-2020 12:48 PM

I tested with a random URL I got from TikTok and with the URL you gave me above

PinkMilk 05-22-2020 01:20 PM

1 Attachment(s)
Quote:

Originally Posted by Irishnotsane (Post 2603031)
I tested with a random URL I got from TikTok and with the URL you gave me above

I'm not sure everythings working fine here, tested on vb3 (which tbh thought this was for) and vb4, FF and Chrome, php 5.6 and 7+

Give this one ago, I've only changed the regex to be more specific but it might make a difference :confused:

Else my only thoughts are conflicting mods

PinkMilk 05-30-2020 04:09 PM

Quote:

Originally Posted by formentera (Post 2603040)
That's happens when you enter the entire url (https://tiktok.com/etc). For other hand, when you enter just the ID of the video, works correctly.

Problem was fixed, it was human error, they used bbcode when not needed, see added notice in post #4 :up:


All times are GMT. The time now is 09:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01132 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete