DivX Plus Web Player 2.0.0 to 2.0.2 problems when changing content.
DivX Plus Web Player 2.0 and 2.0.1 shows no id when changing file, while streaming it sends "DivX Agent" as user agent but when i change a file without reinitializing the plugin it sends nothing.
* EDIT * This was NOT the problem se below.
Ok so it seems that the problem wasn't a missing id but a malformed request, witch stems from the javascript api: "Open('url');"
witch doesn't uri-encode the passed string with the new plugin.
Solution: escape with javascript.
P.s. string stil gets escaped/uri-encoded when using the src attribute.
P.p.s. apparently the "Open()" method is just unfinished as u can't seek ahead beyond the buffered content after using this method, however it's possible to use the 'player.scr' syntax with this player so for a quick hack i use:
p = document.getElementById('divX_plugin');
p.Stop();
v = p.GetVersion();
if(v.indexOf('2.0') == 0)p.src = url;
else p.Open(url);
when changing content (won't work in ie).
Ok so it seems that the problem wasn't a missing id but a malformed request, witch stems from the javascript api: "Open('url');"
witch doesn't uri-encode the passed string with the new plugin.
Solution: escape with javascript.
P.s. string stil gets escaped/uri-encoded when using the src attribute.
P.p.s. apparently the "Open()" method is just unfinished as u can't seek ahead beyond the buffered content after using this method, however it's possible to use the 'player.scr' syntax with this player so for a quick hack i use:
p = document.getElementById('divX_plugin');
p.Stop();
v = p.GetVersion();
if(v.indexOf('2.0') == 0)p.src = url;
else p.Open(url);
when changing content (won't work in ie).
Thanks for the heads up on that issue. I'm pretty sure we can take care of fixing that. :)
In the mean time you could also try just URI encoding the URL using encodeURI(url). This should probably work:
p = document.getElementById('divX_plugin');
p.Open(encodeURI(url));
Also, is there a reason you call Stop() before you call Open()?
Great looking forward to that...
*Stop() before Open():
Yes, had some browser crashing issues in past where it seemed to help (in some browsers) if i stopped the player before opening a new file, haven't testet with the latest plugin.
*encodeURI:
In most cases the same as escaping I was being general obviously not my actual code, but this does not resolve the seek problem.
Regards.
P.s.
I'm just encoding for ie at present.
Ok, I gotcha.
As for the switching/seeking stuff can you explain a little bit more exactly what you are seeing? Are you saying that the user-agent string in the headers is only populated with "DivX Agent" when it makes its first connection to a server during a plugin session but doesn't send it for subsequent requests for that file or other files?
Hi, no i guess i should have edited the first post.
The very first request sends "DivXPlusWebPlayer/2.0.1.94" in the user-agent string, all subsequent requests send "DivX Agent" including when content is changed.
The problem witch i due to the fact that i only allow certain players to access my vids (using the user-agent string) and had just added permissions for - "DivX Agent" and "DivXPlusWebPlayer" - apart from the old "DivXWebPlayer" - missread, was a mallformed requst due to the non uri-uncoded string from the Open() method.
This would show up in the logs:
* mallformed{
400 368 "-" "-"
}
* ok{
206 32768 "-" "DivX Agent"
206 98304 "-" "DivX Agent"
206 32768 "-" "DivX Agent"
206 1048576 "-" "DivX Agent"
206 1048576 "-" "DivX Agent"
206 1048576 "-" "DivX Agent"
206 1048576 "-" "DivX Agent"
206 1048576 "-" "DivX Agent"
...etc.
(I have posted about the problem with these hundreds of tiny request here:
http://labs.divx.com/node/15437)
}
The player alerted:
"The file you are trying to play has failed to finish downloading and can no longer play."
As for the seeking problem - Whenever i use the Open() method (with a uri-uncoded url) i can't seek ahead of the buffered content (as with the old non-plus player), simply nothing happens when i click ahead on the progress-bar. This problem can be overcome using the Player.src = 'url'; syntax whitch however doesn't work in ie.
Hope this clarifies a bit.
Regards
Demian
So you are finding that if you use the Open() method that you cannot seek on for a URL that you can otherwise (via the embed code or player.src)? There is an issue with 2.0.1 (that we've already fixed for another release coming up) that on an HTTP 1.0 server or HTTP 1.1 with byte-ranges disabled that you could not seek beyond the current playback position. That issue happens no matter how you call the URL though. Could you point me to a link where you experience this issue?
I've mailed you a link, please let me know when you'er done.
I've had succes with adding a delay after stopping the vid, before using the Open() method (with regards to seeking beyond the loaded content).
Sometimes it works even without the delay while i'm just messing about, but give it a whirl =), it just seems buggy to me.
The .src = 'url' tech. is not realy a solution - it's very buggy - but i guess it wasn't meant to be. The double src - on the test-page - is intended otherwise the last set src value would start playing.
Demian
P.s. This server (apache) is conf. with http/1.1 and chunked transfer-encoding.



Update 2.0.2
The encoding issue resolved =)
The javascript Open() method now uri-encodes like it should.
The seeking issue remains - gotten worse if anything? doesn't seem to help with the - Stop()/delay/Open() - anymore.
The .src="url";(X2) still enables seeking beyond the loaded bits in firefox.
Demian