Jump to content


Photo

Embed tweets and other videos


  • Please log in to reply
9 replies to this topic

#1 bfc1125roy

bfc1125roy

    Superstar

  • Member
  • 5,572 posts
  • Fan Since:2004
  • Fav. Laker:Kobe Bryant

Posted July 04, 2018 - 02:54 PM

With the offseason going on, can we setup something on the board that auto embeds tweets that are nicely formatted when you input the twitter link, like we do with Youtube videos. Could we also do the same for streamable links? I would be happy to help.

 

Thanks :) 


  • -Wade- likes this

#2 -Wade-

-Wade-

    知己知彼,百戰不殆

  • Moderator
  • 6,558 posts
  • Name:Wade
  • Fav. Laker:♛ Kobe Bryant

Posted July 04, 2018 - 04:32 PM

For IPB custom bb-codes, you need to know the format of the HTML ahead of time. What streamable links in particular are you thinking of? If we can put together a list of the markup, it's simple to create the custom bb-code. It should be very simple for the Twitter one.


0iNkSmB.jpg

 

Q: When you take off your jersey for the final time, what will you leave behind on the court?
A: "My heart and soul." --Kobe Bryant


#3 bfc1125roy

bfc1125roy

    Superstar

  • Member
  • 5,572 posts
  • Fan Since:2004
  • Fav. Laker:Kobe Bryant

Posted July 04, 2018 - 06:43 PM

For IPB custom bb-codes, you need to know the format of the HTML ahead of time. What streamable links in particular are you thinking of? If we can put together a list of the markup, it's simple to create the custom bb-code. It should be very simple for the Twitter one.

 

By streamable I was actually talking about streamable.com links. There have been some relevant videos posted from there lately. If you go to one of those videos, they have the embed HTML code there already, so hopefully it shouldn't be too challenging.


  • -Wade- likes this

#4 bfc1125roy

bfc1125roy

    Superstar

  • Member
  • 5,572 posts
  • Fan Since:2004
  • Fav. Laker:Kobe Bryant

Posted July 05, 2018 - 12:15 PM

Also doe IPB allow for embedded youtube videos to start at a timestamp? It seems to ignore the time parameter when I embed videos


  • -Wade- likes this

#5 -Wade-

-Wade-

    知己知彼,百戰不殆

  • Moderator
  • 6,558 posts
  • Name:Wade
  • Fav. Laker:♛ Kobe Bryant

Posted July 18, 2018 - 08:05 AM

Hey, sorry for the delay in getting back to you.

 

IPB allows for customizable bb-codes with options based on placeholders in markup. All of that is to say, yes -- the technical capability to add embedded Tweets, Streamable players, and YouTube videos starting at a particular time does exist.

I will write the "code" for it and post it shortly, though an Administrator or site developer is going to need to add the implementation.

 

Thanks for your suggestions!


  • Game and bfc1125roy like this

0iNkSmB.jpg

 

Q: When you take off your jersey for the final time, what will you leave behind on the court?
A: "My heart and soul." --Kobe Bryant


#6 -Wade-

-Wade-

    知己知彼,百戰不殆

  • Moderator
  • 6,558 posts
  • Name:Wade
  • Fav. Laker:♛ Kobe Bryant

Posted July 18, 2018 - 10:31 PM

Custom BBCode: YouTube

 

Custom BBCode Description: Embed a YouTube video with optional start time

 

Custom BBCode Example:

[yt=10]FDhAs_WuTg8[/yt]

 

Custom BBCode Tag: yt

 

Use Option in tag?: Yes

 

Option is optional?: Yes

 

Custom BBCode Replacement:

<iframe width="560" height="315" src="https://www.youtube.com/embed/{content}?start={option}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

 

 

------------

 

Custom BBCode: Streamable

 

Custom BBCode Description: Embed a Streamable video

 

Custom BBCode Example:

[stream]n460t[/stream]

 

Custom BBCode Tag: stream

 

Use Option in tag?: No

 

Option is optional?: No

 

Custom BBCode Replacement:

<div style="width: 100%; height: 0px; position: relative; padding-bottom: 56.250%;"><iframe src="https://streamable.com/s/{content}/vjowyf" frameborder="0" width="100%" height="100%" allowfullscreen style="width: 100%; height: 100%; position: absolute;"></iframe></div>

  • bfc1125roy likes this

0iNkSmB.jpg

 

Q: When you take off your jersey for the final time, what will you leave behind on the court?
A: "My heart and soul." --Kobe Bryant


#7 -Wade-

-Wade-

    知己知彼,百戰不殆

  • Moderator
  • 6,558 posts
  • Name:Wade
  • Fav. Laker:♛ Kobe Bryant

Posted July 18, 2018 - 10:32 PM

The Twitter embeds will take a bit longer unfortunately, because they include Javascript in them and IPB prevents that by default. The solution is to write a PHP script and throw it in sources/classes/text/parser/bbcode/ and then have the PHP file parse the BBCode. I'll have to take a crack at that next week when I get back in town.

 

Oh, and for the inline style on the Streamable...we might not want the width to be 100% lol. The functionality is there though. Should probably use rem units instead of pixels as well.


0iNkSmB.jpg

 

Q: When you take off your jersey for the final time, what will you leave behind on the court?
A: "My heart and soul." --Kobe Bryant


#8 bfc1125roy

bfc1125roy

    Superstar

  • Member
  • 5,572 posts
  • Fan Since:2004
  • Fav. Laker:Kobe Bryant

Posted July 19, 2018 - 08:10 PM

Thanks Wade.


  • -Wade- likes this

#9 DTIII

DTIII

    "I am one with the force, the force is with me."

  • Member
  • 5,822 posts
  • Fav. Laker:Kobe & LeBron

Posted July 20, 2018 - 12:10 AM

It would be nice if tweets showed up instead of it just being a link and I don't wanna make a new topic for this but is it just me or are the emotes wonky too?


  • -Wade- likes this

EyMlHkX.jpg


#10 -Wade-

-Wade-

    知己知彼,百戰不殆

  • Moderator
  • 6,558 posts
  • Name:Wade
  • Fav. Laker:♛ Kobe Bryant

Posted July 23, 2018 - 02:13 PM

It would be nice if tweets showed up instead of it just being a link and I don't wanna make a new topic for this but is it just me or are the emotes wonky too?

 

That's what I'm hoping to accomplish with the PHP script. Was thinking something like

 

[tweet]https://twitter.com/Lakers/status/1021497180564193281[/tweet]

 

Would interact with the PHP script such that

 

1. The script would make a request to https://twitter.com/...497180564193281

2. The script would look at the HTML and grab the text/media

3. The script would translate it and then post to the forums

 

The suggestions might not get implemented for a while, but please keep them coming. Always appreciate the feedback. If you can find some free-to-use emoticon packs (20x20 pixels), feel free to post them and we might be able to add some in the future.

 

Thanks!


  • DTIII™ likes this

0iNkSmB.jpg

 

Q: When you take off your jersey for the final time, what will you leave behind on the court?
A: "My heart and soul." --Kobe Bryant





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users