开发者

Web player not playing files with non-ASCII characters

开发者 https://www.devze.com 2023-04-10 05:00 出处:网络
Our app allows users to upload video. I noticed, as soon as someone uploads a video with \"é\" in the file name, the video doesn\'t play.

Our app allows users to upload video.

I noticed, as soon as someone uploads a video with "é" in the file name, the video doesn't play.

For example "fooébar.flv". Question is. Should I be saving file names with those characters or should I filter out those chars? Otherwise, should I find a way for 开发者_运维问答my player to play file names with non-ASCII characters?

I am using JWPlayer, to play the media on our site by the way.

EDIT

I followed http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/16002/embedding-with-international-characters which seems to work with:

encodeURIComponent(encodeURI("path_to_file"))


As per ops request in the comments:

I would let them save with non-ascii characters, you don't want to make it harder for your users to upload.


We solved it this way:

file_path = <%= "http://localhost/#{CGI.escape( URI.escape( 'File name with extra charaters like & áéű' ) )}" %>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号