Project

General

Profile

Actions

Bug #33090

closed

New way to embed youtube videos

Added by Robert Heel over 12 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Frontend
Target version:
-
Start date:
2012-01-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

youtube has a new way to embed videos:

http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html

It automatically uses html5 if the device can't use flash. But it's not easy to integrate this in the current TYPO3 media element.


Files

media_iframe.diff (859 Bytes) media_iframe.diff Robert Heel, 2012-01-10 13:51
33090_media_iframe.diff (872 Bytes) 33090_media_iframe.diff Robert Heel, 2012-01-12 13:08
youtube-video_forge-33090.patch (1.31 KB) youtube-video_forge-33090.patch Stefan Neufeind, 2014-05-30 14:49
youtube-video_forge-33090_4.5.34.patch (1.52 KB) youtube-video_forge-33090_4.5.34.patch Youtube via iframe, against 4.5.34 Stefan Neufeind, 2014-08-08 08:14

Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Feature #25718: Support <iframe> inclusion for Media Content ElementClosed2011-04-01

Actions
Related to TYPO3 Core - Bug #58569: Content element "media" does not render Youtube videosClosed2014-05-06

Actions
Related to TYPO3 Core - Bug #44633: Media-element: Vimeo-video can not play via HTML5Closed2013-01-18

Actions
Related to TYPO3 Core - Feature #61799: Improve the handling of media filesClosedFrans Saris2014-09-22

Actions
Actions #1

Updated by Robert Heel over 12 years ago

Attached a workaround which bypass the generation on youtube links.

Actions #2

Updated by Robert Heel over 12 years ago

Added wmode=Opaque to avoid flash overlay

Actions #4

Updated by Stefan Neufeind almost 10 years ago

This is still an issue in latest TYPO3 CMS (6.2.3). Embedding by using an iframe seems to be the best way.
Here is a slightly different patch, patch also using an iframe.

Of course all these ways are just "hacks" to get it working for the moment. Imho we need to cleanly extend the concept of MediaProviders to fit the new needs - which here is APIs that need iframes and don't allow access to the videos directly anymore.

Actions #5

Updated by Stefan Neufeind almost 10 years ago

  • Tracker changed from Feature to Bug
  • Subject changed from New way to embed youtube videos with html5 to work on ipad to New way to embed youtube videos
Actions #6

Updated by Markus Klein almost 10 years ago

  • Is Regression set to No

I agree we need to restructure the Media Providers a lot. Currently you can only modify the path to videos within a provider. IMO a provider should be much more general. Meaning it should be capable of rendering the whole html output and providing also adequate fields in the backend. The html should be fluid based. A provider should be an adapter between the Core and the source API, like YouTube or Vimeo.

Actions #7

Updated by Stefan Neufeind almost 10 years ago

Could we maybe agree on some "hack" to get youtube working again with one of the next releases? I doubt that a full restructuring will arrive in the short run - and even then it would need a decision if such a "new" MediaProvider-interface can be introducted in the 6.2.x-branch.

Actions #8

Updated by Markus Klein almost 10 years ago

From what I saw, I can tell that after the current media provider parses and rewrites the youtube url it uses the default SWFOJECT rendering of cObj (object-embed HTML code)

I don't have time currently to take a closer look how we could "hack" that now to get an iframe in 6.2.

By the way: Youtube is NOT broken currently, after applying the fix https://review.typo3.org/29952

Actions #9

Updated by Stefan Neufeind almost 10 years ago

Oh yes, that patch went in after 6.2.3-release. I just tried it out. Works fine on a machine where you have Flash available. For things like an an ipad that of course fails - in contrast to the iframe-embededing directly from youtube (which detects HTML5-capable players).

Actions #10

Updated by Markus Klein almost 10 years ago

Yep of course. iframe player detection is much more intelligent!

Actions #11

Updated by Stefan Neufeind over 9 years ago

Attached is the same patch/hack for using Youtube via iframe, redone against 4.5.34

Actions #12

Updated by Johannes C. Schulz over 9 years ago

Is there some magic to do within the plugin? I patched my 6.2.4 but youtube in media-element remains SWFOBJECT ínstead of IFRAME.

Actions #13

Updated by Stefan Neufeind over 9 years ago

No magic involved. Then please check the source again. What URLs does the mediaprovider return for you, is the mode correctly set to iframe etc.?

Actions #14

Updated by Johannes C. Schulz over 9 years ago

My plugin-settings:
Medientyp: Video
HTML5: nein
Breite:
Höhe:
Darstellungstyp: auto
URL: http://youtu.be/anM5lsLPwPE

in MediaContentObject.php I've changed:

$urlRewritten = $mediaWizard->rewriteUrl($conf['file']);
                if( (strpos($urlRewritten, 'www.youtube.com') !== FALSE) || (strpos($urlRewritten, 'youtu.be') !== FALSE) ) {
                    $renderType = 'iframe';
                }

PageContent is:

<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/anM5lsLPwPE?fs=1" width="600" height="400" id="mmswf53fedb6e1c783" style="visibility: visible;"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="sameDomain"><param name="allowFullScreen" value="true"><param name="wmode" value="opaque"></object>

There is no option "IFRAME" inside the plugin.

Johannes

Actions #15

Updated by Stefan Neufeind over 9 years ago

Well, you missed the second half of the patch ...

Actions #16

Updated by Johannes C. Schulz over 9 years ago

No ;-) - It's also there.

case 'iframe':
                $url = $urlRewritten;
                $width = $conf['parameter.']['mmWidth'] ?: '100%';
                $height = $conf['parameter.']['mmHeight'] ?: '100%';
                $frameBorderAttribute = ' style="border:0px"';
                // literally taken from EXT:news/Classes/MediaRenderer/Video/Youtube.php
                $content = '<div class="wrapper"><div class="h_iframe"><iframe width="' . $width . '" height="' . $height . '" src="' . htmlspecialchars($url) . '"' . $frameBorderAttribute . '></iframe></div></div>';
                break;

Actions #17

Updated by Benni Mack over 9 years ago

  • Assignee set to Benni Mack
  • Target version set to 7.2 (Frontend)
Actions #18

Updated by Markus Klein over 9 years ago

See extension of Frans which shall be the new way to do it.
https://github.com/fsaris/fal_online_media_connector

Actions #19

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Actions #20

Updated by Susanne Moog over 8 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #21

Updated by Benni Mack over 8 years ago

  • Category changed from 1050 to 1606
  • Target version deleted (7.5)
Actions #22

Updated by Georg Ringer over 8 years ago

TYPO3 CMS 7 now can handle that in a nice way without flash. therefore I am closing this issue.

Actions #23

Updated by Georg Ringer over 8 years ago

  • Status changed from New to Closed

feel free however to open new issue for this ext at https://github.com/FriendsOfTYPO3/mediace/issues/

Actions #24

Updated by Alexander Dick about 8 years ago

The wmode parameter should be added to the urlParams.
If the browser supports flash or it is an older browser that doesn't support html5 videos, youtube still uses flash.

sysext/core/Classes/Resource/Rendering/YouTubeRenderer.php

public function render(FileInterface $file, $width, $height, array $options = null, $usedPathsRelativeToCurrentScript = false) {

 [...]
 $urlParams = array('wmode=transparent', 'autohide=1');
 [...]

The result:

<iframe src="//www.youtube.com/embed/XXXVideoIDXXX?autohide=1&amp;wmode=transparent&amp;controls=2&amp;enablejsapi=1&amp;origin=domain.tld&amp;showinfo=0" allowfullscreen frameborder="0" title=""></iframe>
Actions #25

Updated by Markus Klein about 8 years ago

Alexander, this ticket is closed. Please open a new one.

Actions

Also available in: Atom PDF