2

我试图找出在这里编码字符串的正确方法。在我的云端安装中(即在我的 S3 存储桶上),我有一个带有特殊字符的文件夹:

播放列表/Medúlla/file.m4a

尝试使用此功能时:

playlist: [{file: "rtmp://MYCLOUDFRONTDISTRO/cfx/st/mp4:playlists/Medúlla/myfile.m4a"}],

在 jwplayer 播放列表中,如何正确编码 jWPlayer 中的播放列表条目?(最好在输出之前在 ColdFusion 中使用)。如果我使用urlEncodedFormat(),一切都会被编码。就好像我需要对特殊字符做点什么,但我不知道是什么(以及如何)。

作为旁注,一切正常,除非我在这个 javascript 配置中有一个 UTF8 字符。

更新:

缩小范围:如果我硬编码 HTML,它工作正常。如果我将播放列表保存到 ColdFusion 变量中并在 JS 配置中输出该变量,它将不起作用。

这是 JWPlayer 工作时的控制台调试:

JWPLAYERREADY ([PlayerEvent type="jwplayerReady" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

JWPLAYERPLAYLISTLOADED ([PlaylistEvent type="jwplayerPlaylistLoaded" index="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

JWPLAYERPLAYLISTITEM ([PlaylistEvent type="jwplayerPlaylistItem" index="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

LOG(调度类型的字幕事件:jwplayerCaptionsList)

JWPLAYERCAPTIONSLIST ([CaptionsEvent type="jwplayerCaptionsList" track="[object Object]" currentTrack="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

LOAD(加载 PlaylistItem:[PlaylistItem file=rtmp://MYCLOUDFRONTURL/cfx/st/mp4:playlists/Róisín Murphy/Overpowered/10 Tell Everyone.m4a provider=rtmp level=0])

JWPLAYERMEDIABEFOREPLAY ([MediaEvent type="jwplayerMediaBeforePlay" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERMEDIALEVELS ([MediaEvent type="jwplayerMediaLevels" levels="[object Object]" currentQuality="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERMEDIALOADED ([MediaEvent type="jwplayerMediaLoaded" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERPLAYERSTATE ([PlayerStateEvent type="jwplayerPlayerState" oldstate="IDLE" newstate="BUFFERING" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

JWPLAYERMEDIABUFFERFULL ([MediaEvent type="jwplayerMediaBufferFull" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERMEDIAMETA ([MediaEvent type="jwplayerMediaMeta" screenwidth="0" transitioning="false" bufferfill="0" bandwidth="0" qualitylevel="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version= “6.2.3115”])

JWPLAYERMEDIAMETA ([MediaEvent type="jwplayerMediaMeta" audiochannels="2" audiosamplerate="44100" tags="" audiocodecid="mp4a" type="metadata" trackinfo="[object Object]" duration="231.48" aacaot="2 " moovPosition="40" id="gwsPlayer" 客户端="FLASH WIN 11,5,502,149" 版本="6.2.3115"])

LOG(调度类型的字幕事件:jwplayerCaptionsList)

JWPLAYERCAPTIONSLIST ([CaptionsEvent type="jwplayerCaptionsList" track="[object Object]" currentTrack="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERPLAYERSTATE ([PlayerStateEvent type="jwplayerPlayerState" oldstate="BUFFERING" newstate="PLAYING" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

JWPLAYERMEDIATIME ([MediaEvent type="jwplayerMediaTime" duration="231.48" position="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERMEDIAMETA ([MediaEvent type="jwplayerMediaMeta" screenwidth="0" transitioning="false" bufferfill="1.5" bandwidth="2037" qualitylevel="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version= “6.2.3115”])

JWPLAYERMEDIATIME ([MediaEvent type="jwplayerMediaTime" duration="231.48" position="0.1" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERMEDIAMETA ([MediaEvent type="jwplayerMediaMeta" screenwidth="0" transitioning="false" bufferfill="2" bandwidth="2037" qualitylevel="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version= “6.2.3115”])

JWPLAYERMEDIATIME ([MediaEvent type="jwplayerMediaTime" duration="231.48" position="0.3" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])
--snip--

并具有相同的HTML,但通过 CF 输出

JWPLAYERREADY

([PlayerEvent type="jwplayerReady" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

JWPLAYERPLAYLISTLOADED ([PlaylistEvent type="jwplayerPlaylistLoaded" index="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

JWPLAYERPLAYLISTITEM ([PlaylistEvent type="jwplayerPlaylistItem" index="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

LOG(调度类型的字幕事件:jwplayerCaptionsList)

JWPLAYERCAPTIONSLIST ([CaptionsEvent type="jwplayerCaptionsList" track="[object Object]" currentTrack="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

LOAD(加载 PlaylistItem:[PlaylistItem file=rtmp://MYCLOUDFRONTURL/cfx/st/mp4:playlists/Róisín Murphy/Overpowered/10 Tell Everyone.m4a provider=rtmp level=0])

JWPLAYERMEDIABEFOREPLAY ([MediaEvent type="jwplayerMediaBeforePlay" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERMEDIALEVELS ([MediaEvent type="jwplayerMediaLevels" levels="[object Object]" currentQuality="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERMEDIALOADED ([MediaEvent type="jwplayerMediaLoaded" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERPLAYERSTATE ([PlayerStateEvent type="jwplayerPlayerState" oldstate="IDLE" newstate="BUFFERING" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115" message="null"])

JWPLAYERMEDIABUFFERFULL ([MediaEvent type="jwplayerMediaBufferFull" id="gwsPlayer" client="FLASH WIN 11,5,502,149" version="6.2.3115"])

JWPLAYERMEDIAMETA ([MediaEvent type="jwplayerMediaMeta" transitioning="false" qualitylevel="0" screenwidth="0" bandwidth="0" bufferfill="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" 版本= “6.2.3115”])

JWPLAYERMEDIAMETA ([MediaEvent type="jwplayerMediaMeta" transitioning="false" qualitylevel="0" screenwidth="0" bandwidth="0" bufferfill="0" id="gwsPlayer" client="FLASH WIN 11,5,502,149" 版本= “6.2.3115”])

--剪辑--

4

1 回答 1

0

终于找到了我自己的答案:当我应该更仔细地查看数据是如何导入的时,我过于专注于输出:结果使用 CFFILE 上传然后读取可能会导致各种编码问题。通过简单地使用文本字段而不是文件上传来解决问题,等等,存储在数据库中的编码很好。我正在使用受污染的数据进行所有测试。叹息

吸取教训,继续前进...... :)

于 2013-05-10T07:55:38.337 回答