Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

A bug in "get playerBaseUrl" or a bug in "getDomainEnd" ? #299

@wswfc

Description

@wswfc

Hi there, not sure if it is a known issue, anyway when I am using flowplayer + rtmp plugin, I found that flowplayer cannot load the rtmp plugin.

I think what is special in my setup is the url for flowplayer looks like:
http://xx.xx.xx.xx:yyyy/flowplayer-3.2.18.swf
where "xx.xx.xx.xx" is IP address and "yyyy" is a specific port (not 80).

If I setup the url to be "http://xx.xx.xx.xx:yyyy/foo/flowplayer-3.2.18.swf", i.e.. with a "foo/" in the url, there is no such issue.

After enable trace log and further debugging, I think it is related to the function allowCodeLoading() in
https://github.com/flowplayer/flash/blob/master/lib/common/src/actionscript/org/flowplayer/util/DomainUtil.as

It alwasy return false in my setup. Further looking from trace log, it is shown that in this function,
"player domain" is "xx.xx:yyyy" whereas "resource domain " is "xx.xx". So these two cannot match.

This is because "URLUtil.playerBaseUrl" is "http://xx.xx.xx.xx:yyyy" not "http://xx.xx.xx.xx:yyyy/" - note the last slash. And resouce url is "http://xx.xx.xx.xx:yyyy/flowplayer.rtmp-3.2.13.swf". Our url parsing logic would generate different domain name for above two urls...

To fix this issue, I think we should either fix the function "get playerBaseUrl" in
https://github.com/flowplayer/flash/blob/master/core/src/actionscript/org/flowplayer/util/URLUtil.as
with "return url.substring(0, lastSlashBeforeSwf + 1);" so the "URLUtil.playerBaseUrl" could be "http://xx.xx.xx.xx:yyyy/"

or we can fix the getDomainEnd() in
https://github.com/flowplayer/flash/blob/master/lib/common/src/actionscript/org/flowplayer/util/DomainUtil.as
so it can correctly sub the ":yyyy".

Any thoughts?

Thanks,
wswfc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions