Bug 121964 - Embedded Youtube.com videos don't play
Summary: Embedded Youtube.com videos don't play
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: nspluginviewer (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: George Staikos
URL:
Keywords:
: 130697 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-02-14 17:11 UTC by Carlos Sanchis
Modified: 2009-01-03 12:36 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch (1.34 KB, patch)
2006-07-21 20:23 UTC, Maksim Orlovich
Details
A somewhat nicer version (2.34 KB, patch)
2006-07-22 18:22 UTC, Maksim Orlovich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Sanchis 2006-02-14 17:11:58 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    SuSE RPMs
OS:                Linux

Youtube.com is a popular site where people upload videos. They can be embedded in other websites as a flash animation that plays the actual video. You can't play those videos on Konqueror with Macromedia's flashplayer plugin whilst Firefox and Opera do play those videos. Here's an example: http://mblog.lib.umich.edu/~rdivecha/archives/2006/02/the_world_of_sm.html

This is related to another BR: https://bugs.kde.org/show_bug.cgi?id=121298
Comment 1 Tom Kiermaier 2006-03-05 21:41:05 UTC
I've noticed the same problem using konq 3.5.1 (gentoo monolithic packages)
Comment 2 Bazzani Marco 2006-03-28 13:37:38 UTC
same problem here konq 3.5.1
Comment 3 Pablo 2006-04-05 00:53:42 UTC
Doesn't work with konqui 3.5.2 either.
Comment 4 kde 2006-04-07 03:13:39 UTC
*** This bug has been confirmed by popular vote. ***
Comment 5 Ismail Donmez 2006-04-29 15:45:48 UTC
Simplest testcase :

<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/MiIm4Brfog4"></param>
<embed src="http://www.youtube.com/v/MiIm4Brfog4" type="application/x-shockwave-flash" width="425" height="350">
</embed>
</object>

problem seems to the "value" field is not passed correctly and is passed as undefined.
Comment 6 Ismail Donmez 2006-05-01 15:00:55 UTC
Assigning to nspluginviewer. Here is additional comments from a YouTube developer:

==========================================
I think the problem is that you are not passing the redirected variables 
down to the flash player itself. When http://www.youtube.com/v/MiIm4Brfog4 
is hit it will redirect to 
http://www.youtube.com/p.swf?video_id=<video_id>&<other variables...>
What should happen at this point is that the browser should load up p.swf 
in the flash player and pass all variables down to it. I am guessing that 
the variables returned in the redirect are not passed into the flash 
player.
==========================================
Comment 7 Haris Kouzinopoulos 2006-06-01 04:03:42 UTC
A little me too post, since this bug is quite annoying... Btw, the video is amazing :)
Comment 8 P B 2006-06-09 05:48:24 UTC
Still true as of 3.5.3
Comment 9 Maksim Orlovich 2006-07-12 15:51:00 UTC
*** Bug 130697 has been marked as a duplicate of this bug. ***
Comment 10 Maksim Orlovich 2006-07-21 20:23:09 UTC
Created attachment 17059 [details]
patch

This updates URLs in stream information structure if we get redirected. pmax,
please review. Seems to fix this.
Comment 11 Ismail Donmez 2006-07-21 20:57:58 UTC
Maksim's patch fixes it here :-) . Yay!
Comment 12 Maksim Orlovich 2006-07-22 18:22:05 UTC
Created attachment 17091 [details]
A somewhat nicer version

I think this one is cleaner?
Comment 13 George Staikos 2006-07-25 03:21:30 UTC
Looks good.
Comment 14 Maksim Orlovich 2006-07-25 05:17:06 UTC
SVN commit 565998 by orlovich:

If we get redirected when grabbing a file, tell the plugin about the final URL 
and not the original one. Fixes playback of youtube videos embedded in other web sites.
BUG:121964


 M  +15 -0     nsplugin.cpp  
 M  +2 -0      nsplugin.h  


--- branches/KDE/3.5/kdebase/nsplugins/viewer/nsplugin.cpp #565997:565998
@@ -1602,6 +1602,12 @@
     return true;
 }
 
+void NSPluginStreamBase::updateURL( const KURL& newURL )
+{
+    _url = newURL;
+    free(const_cast<char*>(_stream->url));
+    _stream->url = strdup(_url.url().ascii());
+}
 
 int NSPluginStreamBase::process( const QByteArray &data, int start )
 {
@@ -1824,6 +1830,8 @@
                 SLOT(totalSize(KIO::Job *, KIO::filesize_t)));
         connect(_job, SIGNAL(mimetype(KIO::Job *, const QString &)),
                 SLOT(mimetype(KIO::Job *, const QString &)));
+        connect(_job, SIGNAL(redirection(KIO::Job *, const KURL&)),
+                SLOT(redirection(KIO::Job *, const KURL&)));
     }
 
     return false;
@@ -1847,6 +1855,8 @@
                 SLOT(totalSize(KIO::Job *, KIO::filesize_t)));
         connect(_job, SIGNAL(mimetype(KIO::Job *, const QString &)),
                 SLOT(mimetype(KIO::Job *, const QString &)));
+        connect(_job, SIGNAL(redirection(KIO::Job *, const KURL&)),
+                SLOT(redirection(KIO::Job *, const KURL&)));
     }
 
     return false;
@@ -1863,6 +1873,11 @@
     }
 }
 
+void NSPluginStream::redirection(KIO::Job * /*job*/, const KURL& url)
+{
+    updateURL( url );
+}
+
 void NSPluginStream::totalSize(KIO::Job * job, KIO::filesize_t size)
 {
     kdDebug(1431) << "NSPluginStream::totalSize - job=" << (void*)job << " size=" << KIO::number(size) << endl;
--- branches/KDE/3.5/kdebase/nsplugins/viewer/nsplugin.h #565997:565998
@@ -85,6 +85,7 @@
   bool create( const QString& url, const QString& mimeType, void *notify, bool forceNotify = false );
   int tries() { return _tries; }
   void inform( );
+  void updateURL( const KURL& newURL );
 
   class NSPluginInstance *_instance;
   uint16 _streamType;
@@ -126,6 +127,7 @@
   void totalSize(KIO::Job *job, KIO::filesize_t size);
   void mimetype(KIO::Job * job, const QString &mimeType);
   void result(KIO::Job *job);
+  void redirection(KIO::Job *job, const KURL& url);
   void resume();
 
 protected:
Comment 15 alan 2008-01-08 18:57:02 UTC
I still have a problem with youtube videos with 64bit mode and nspluginwrapper.  The same combination works with Firefox.  As soon as you select a page which should have a video on, the page goes full screen displays like that for a few seconds and then 
Comment 16 Georg Wittenburg 2009-01-03 12:36:55 UTC
I'm seeing the same symptoms in 4.1.86 (using unofficial Debian packages from kde42.debian.net version 4:4.1.86+svn902162-0r1). Testcase is at http://www.spiegel.de/netzwelt/web/0,1518,595451,00.html.