google-code-export / flowplayer-core

Automatically exported from code.google.com/p/flowplayer-core
2 stars 0 forks source link

3.2.8 new escaping mechanism creates problem with aws s3 signed urls #496

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
See:
http://flowplayer.org/forum/support.html?id=77915

Up to 3.2.7 aws s3 signed urls worked when wrapped in escape(). Stopped working 
in 3.2.8.

Apparently aws gives this kind of url:
http://s3.amazonaws.com/dev.media.burst.it/a%2F717390096%2Fv%2F38728778576478400
0_100%2Flq.mp4?Expires=1318892656&AWSAccessKeyId=AKIAJINM3X4VNFXVN4FA&Signature=
7FPFPrYi2mttQfymwKy2ZLXnac4%3D

See also:
http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding
/7379/intermittent-starts-with-amazon-s3-expiring-urls

Original issue reported on code.google.com by blacktrashproduct on 15 Mar 2012 at 1:27

GoogleCodeExporter commented 9 years ago
This is really important for us. We got the licensee and there is no way to get 
the commercial .swf which is one version prior i.e. 3.2.7. AND 3.2.8 is not 
usable for us :(

Original comment by hroon...@gmail.com on 15 Mar 2012 at 1:49

GoogleCodeExporter commented 9 years ago
releases.flowplayer.org/flowplayer/flowplayer.commercial-3.2.7.zip
should get you going, see also my answer in the support forum.

You can help us by clarifying exactly which format the url is, which is fed to 
flowplayer - this cannot _reliably_ determined by console output in a browser. 
Is it like I quoted above, or how you _first_ wrote in the suppor thread:
http://s3.amazonaws.com/dev.media.burst.it/a/717390096/v/387287785764784000_100/
lq.mp4?Expires=1318892656&AWSAccessKeyId=AKIAJINM3X4VNFXVN4FA&Signature=7FPFPrYi
2mttQfymwKy2ZLXnac4%3D
i.e. no escaped slashes in the non-query part?

Original comment by blacktrashproduct on 15 Mar 2012 at 3:20

GoogleCodeExporter commented 9 years ago
Please provide a basic example if possible. Do you have an example page ? I am 
unable to access the forum i'm afraid. 

Original comment by dani...@electroteque.org on 15 Mar 2012 at 3:26

GoogleCodeExporter commented 9 years ago
This is the working 3.2.7 sample:
https://dev.burst.it/bw/index.html#!/moments/momentsFrom/media:OTE2NDgyNzA0MjI1O
TI4MDAwOjEzMzIzNDQxMDAzNzc6ZWUyMDQ3NDUyZGQzMzQ2YzBhNWJkNDU5MzhjMWJjZmY=

This is the failing 3.2.8 sample:
https://dev.burst.it/bwtest/index.html#!/moments/momentsFrom/media:OTE2NDgyNzA0M
jI1OTI4MDAwOjEzMzIzNDQxMDAzNzc6ZWUyMDQ3NDUyZGQzMzQ2YzBhNWJkNDU5MzhjMWJjZmY=

Not exactly basic ...

Note as well that the clip urls are expiring urls, I guess they are retrieved 
in some way from aws, but I am not sure in what exact format they "arrive" from 
aws.

Original comment by blacktrashproduct on 15 Mar 2012 at 4:42

GoogleCodeExporter commented 9 years ago
Possible to strip out your logic to a seperate page ? too convoluted with 
compressed javascript and I just get a loading notice, it's not loading for me 
I'm afraid. 

Original comment by dani...@electroteque.org on 15 Mar 2012 at 4:53

GoogleCodeExporter commented 9 years ago
Right its not a cloudfront secure plugin setup but a direct url. 

If i configure 

http://s3.amazonaws.com/dev.media.burst.it/a/717390096/v/387287785764784000_100/
lq.mp4?Expires=1318892656&AWSAccessKeyId=AKIAJINM3X4VNFXVN4FA&Signature=7FPFPrYi
2mttQfymwKy2ZLXnac4%3D

It requests correctly, I just get a 403 obviouslly because its expired. 

Original comment by dani...@electroteque.org on 15 Mar 2012 at 6:00

GoogleCodeExporter commented 9 years ago
This url which has problem and is using 3.2.8 is-
https://dev.burst.it/bwtest/index_dev.html#!/moments/momentsFrom/media:MjkwOTAwN
TQwNTM4MTMyMDAwOjEzMzI0NDQyOTk4NDU6ZjU5N2I4NzhjOTBlNTliZGViOGMwNjA3MzMwZjk1NTI=
(I cleaned up codeso it is not compressed javascript)

The url where the same video works on 3.2.7 is-
https://dev.burst.it/bw/index.html#!/moments/momentsFrom/media:MjkwOTAwNTQwNTM4M
TMyMDAwOjEzMzI0NDQyOTk4NDU6ZjU5N2I4NzhjOTBlNTliZGViOGMwNjA3MzMwZjk1NTI=

The urls above will stop working 6 days from now.

Original comment by hroon...@gmail.com on 16 Mar 2012 at 4:59

GoogleCodeExporter commented 9 years ago
The url from amazon in both cases is 
http://s3.amazonaws.com/dev.media.burst.it/a%2F522809591%2Fv%2F33173273690044900
0_100%2Flq.mp4?Expires=1332533968&AWSAccessKeyId=AKIAJ4YTDPXV65Z2PIYQ&Signature=
5Kgd7kU2mJ7g%2FMeoqkX4XSsgwPM%3D

(you can plug it in quicktime and it works for next 6 days)

Original comment by hroon...@gmail.com on 16 Mar 2012 at 8:21

GoogleCodeExporter commented 9 years ago
Hi as explained, your site does not work for me, I just get a loading 
animation, I am on OSX Chrome. If possible are you able to provide a page with 
the flowplayer config so it can be visually seen I dont see a config or 
anything thanks. 

Original comment by dani...@electroteque.org on 16 Mar 2012 at 10:12

Attachments:

GoogleCodeExporter commented 9 years ago
I can play the clip in mplayer - QuickTime Player cannot handle the url either.

Original comment by blacktrashproduct on 17 Mar 2012 at 1:08

GoogleCodeExporter commented 9 years ago
JWPlayer's bugfix for this is to revert to Flowplayer's 3.2.7 behaviour, i.e. 
leave the url encoding (via encodeURIComponent or escape) to the user; in 3.2.8 
Flowplayer's cleverness prevents amazon signed urls from playback - at least I 
have so far not found a way of (un)escaping the url in way that 3.2.8 likes it.

See:
http://developer.longtailvideo.com/trac/ticket/729#comment:5

Status changed from new to closed
Resolution set to fixed
Fixed in http://developer.longtailvideo.com/trac/changeset/1270. 
This update will require all non-ascii characters to be URL encoded before 
passing them into the player. For example, it was previously possible to set 
the "file" option to "/testing/files/παίχτης.flv". Now, this URI must be 
encoded as 
"http://pablotest.longtailvideo.com/testing/files/%CF%80%CE%B1%CE%B9%CC%81%CF%87
%CF%84%CE%B7%CF%82.flv". The player will no longer automatically URL encode 
these values, as doing so can prevent properly encoded URLs (such as certain 
Amazon Private Content URLs) from loading properly.

Original comment by blacktrashproduct on 17 Mar 2012 at 1:27

GoogleCodeExporter commented 9 years ago
Here's finally a minimal demo 3.2.7 vs 3.2.8:
http://flowplayer.blacktrash.org/test/amazons3.html

But now I'm completely confused because in 3.2.7 simply giving the url works, 
escape(url) does not.

3.2.8 does not work at all.

Original comment by blacktrashproduct on 17 Mar 2012 at 1:39

GoogleCodeExporter commented 9 years ago
3.2.8 reacts to any "%" percent sign in the clip url by url-encoding "blindly", 
thus turning e.g. *all* "%2F" (urlencoded "/") into "%252F" - 3.2.7 leaves 
"%2F" as it is.

Verified with invalid urls in error message unrelated to cloudfront.

Original comment by blacktrashproduct on 17 Mar 2012 at 2:11

GoogleCodeExporter commented 9 years ago
thanks. 

Original comment by dani...@electroteque.org on 17 Mar 2012 at 2:40

GoogleCodeExporter commented 9 years ago
obj = 
obj.replace(/(%)/g,"%25").replace(/'/g,'\\u0027').replace(/"/g,'\\u0022').replac
e(/&/g,'%26'); 

would these character replacements have anything to do with it. most likely 
does.

Original comment by dani...@electroteque.org on 17 Mar 2012 at 2:43

GoogleCodeExporter commented 9 years ago
It was somehow encoding the urls before but after a fix for the relative path 
issue, its been resolved. 

however if I turn on urlEncoding: true its double encoding perhaps and causing 
the issue. Those character replacements were to simply get the player loaded. 
so even if they are done externally (encode etc does not replace with the 
correct characters), with the config on it may not work :( would someone still 
need urlEncoding on with such a url perhaps ? 

Can possible remove the % replacement for now. 

Anyway your version is out of date I have built you the correct one with the 
change

http://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.8.zip

Original comment by dani...@electroteque.org on 17 Mar 2012 at 3:19

GoogleCodeExporter commented 9 years ago
You guy are rockstars. This worked very well. Thanks!

Original comment by hroon...@gmail.com on 19 Mar 2012 at 4:10

GoogleCodeExporter commented 9 years ago
btw this build 
(http://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.8.zip) seem to have 
unintended bug which is when you hit pause play multiple times the video never 
plays.(I think after 3 or so combo)
see attached screenshot

Original comment by hroon...@gmail.com on 19 Mar 2012 at 5:52

Attachments:

GoogleCodeExporter commented 9 years ago
the above issue of pause/play multiple time is not a new issue. It is occurring 
in 3.2.7 as wel..Sorry for the misinfo.

Original comment by hroon...@gmail.com on 19 Mar 2012 at 6:32

GoogleCodeExporter commented 9 years ago
Do you have a demo of this perhaps ? 

Original comment by dani...@electroteque.org on 20 Mar 2012 at 1:13

GoogleCodeExporter commented 9 years ago
go to this link and hit play/pause few times in a succession.
https://dev.burst.it/bw/index.html#!/moments/momentsFrom/media:MTU5MzE5MjQwNTk5O
DcxMDAwOjEzMzI4NjEwOTE4MzQ6MzRiMGJkNjA0OGI5M2UxMThlNTgwMmM3MWVjNDMyMTA=

Original comment by hroon...@gmail.com on 20 Mar 2012 at 3:38

GoogleCodeExporter commented 9 years ago
Hi there I dont see any issue, the video is also very small. Unfortunately your 
site does not work on chrome OSX, I loaded up safari and its working. 

Original comment by dani...@electroteque.org on 21 Mar 2012 at 5:36

GoogleCodeExporter commented 9 years ago
@blacktrash please confirm this is working now. 

Original comment by dani...@electroteque.org on 21 Mar 2012 at 5:36

GoogleCodeExporter commented 9 years ago
Hi Dani-
Ignore the video size as the video was taken in low quality. The site should be 
working in chrome on osx as I use the same configuration.
Maybe clear the cache and try. This is not working either on 3.2.8 or 3.2.7, by 
"this" I mean doing play/pause rapidly causes the player to hang (the loading 
rotating icon freezes and no controls work after that, unless I refresh the 
page)

Original comment by hroon...@gmail.com on 21 Mar 2012 at 5:36

GoogleCodeExporter commented 9 years ago
1) Site does not work in chrome
2) The video duration is very short to properly test this
3) I'm not seeing the issue here. 
4) please setup a seperate bug report if you think its a problem ? Copy and 
paste debug logs also perhaps. 

Original comment by dani...@electroteque.org on 21 Mar 2012 at 5:49

GoogleCodeExporter commented 9 years ago
closing this for now considered fixed. 

Original comment by dani...@electroteque.org on 26 Mar 2012 at 2:18

GoogleCodeExporter commented 9 years ago
I still don't know what to do.

Here is what I was doing with 3.2.7 which was working

String encUrl = mediaUrl.replace(' ', '+');
encUrl = URL.encodeQueryString(encUrl);

Now this doesn't work and I'm not sure what to do.

Note I am playing video via rmtp using Wowza media server hosted on EC2.

Original comment by virtualb...@gmail.com on 30 Mar 2012 at 7:54