Bug #86950

styles.content.textmedia.maxW TypoScript constant not valid for Youtube videos

Added by Sergio Catalá 9 months ago. Updated 15 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-11-20
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
CodingNight
Complexity:
Is Regression:
Sprint Focus:

Description

Using TYPO3 8.7 core.

It seems TypoScript constant styles.content.mediatext.maxW is respected for Text+Media content elements that attach images, but not for Youtube videos. A large image is scaled to that maximum width. However, a Youtube video has always maximum width 480px for the frame, even if you set the maximum width larger. Has anyone experienced this issue?

I tested it over TYPO3 9.5 and 8.7 cores.

History

#1 Updated by Sergio Catalá 9 months ago

  • Description updated (diff)

#2 Updated by Sergio Catalá 9 months ago

  • Subject changed from maxWInText TypoScript setting not valid for Youtube videos to styles.content.textmedia.maxW TypoScript constant not valid for Youtube videos

#3 Updated by Riccardo De Contardi 7 months ago

I performed tests on TYPO3 8.7.22, 9.5.3 and latest master

My tests:

Test 1

1) put on TS Constants:

styles.content.textmedia.maxW = 300
styles.content.textmedia.maxWInText = 150

2) Create a CE Text and Media
3) put in it a "media by URL (e.g. https://www.youtube.com/watch?v=HmZKgaHa3Fg)
4) set Number of Columns = 1

Results

On both the cases:
- Position and Alignment: Above,center [0]
- Position and Alignment: Intext, Left [18]

the video box is resized to the dimensions specified in the constants.

Test 2

1) put on TS Constants:

styles.content.textmedia.maxW = 600
styles.content.textmedia.maxWInText = 600

2) Create a CE Text and Media
3) put in it a "media by URL (e.g. https://www.youtube.com/watch?v=HmZKgaHa3Fg)
4) set Number of Columns = 1

Results

On both the cases:
- Position and Alignment: Above,center [0]
- Position and Alignment: Intext, Left [18]

The video is resized with a width= 480px

Test 3

Same as test 2, but I set Width of each element (px) = 900px

Results:

Now the video box is resized to the dimensions specified in the constants.

It seems that 480px is a kind of "standard" dimension that is set if no width is specified on the media element field (imagewidth).

#4 Updated by Sergio Catalá 7 months ago

I have the same results as you, Riccardo, except test 3.
I think you made a mistake there with the test?
Even if setup the constant as 900, the youtube video width is still 480px.

So that's a TYPO3 bug, or being a standard, we cannot keep the width larger?

#5 Updated by Riccardo De Contardi 7 months ago

@Sergio I repeated my last test on a different TYPO3 installation, brand new.

TS Constants:

styles.content.textmedia.maxW = 600
styles.content.textmedia.maxWInText = 600

- Add media element
- Add media by URL (e.g. https://www.youtube.com/watch?v=4voI_kMl8gs)
- [imagewidth] = 900px
- [imageorient] = above, Center (18)

Maybe I explained myself badly: 900px is a value set in the content element created (Media Adjustments >
Width of each element (px)[imagewidth])

Results:

The video box is resized with a width of 600px

About the "magic" 480px value I don't know... I was not able to find where it comes from so far.

#6 Updated by Sergio Catalá 7 months ago

Ok, I misunderstood.
I never do my tests setting up the width over the content element. I only change the TypoScript constant.
This is precisely what I'm interested in: where this 480px comes from. It seems that if we setup the constant larger than '480', it doesn't take any effect.

#7 Updated by Riccardo De Contardi 7 months ago

As far as I have seen, the dimensions 480x270 (which are the default dimensions for youtube videos) are written in the database sys_file_metadata table when you create a youtube record.

#8 Updated by Sergio Catalá 6 months ago

And is that ok, Riccardo? Or a bug from core?
As far as I can see, dimensions cannot be changed inside metadata of .youtube file through Filelist module in BE.

#9 Updated by Riccardo De Contardi 6 months ago

Honestly, I don't know... sorry

#10 Updated by Riccardo De Contardi 15 days ago

  • Tags set to CodingNight

Also available in: Atom PDF