Closed GoogleCodeExporter closed 8 years ago
While I am not positive, I believe this is a javascript compatibility issue of
the
plugin. I'll have to look at this a little more but I believe the site uses
javascript that the plugin does not emulate.
Original comment by kdeko...@gmail.com
on 10 Feb 2010 at 3:48
Did you ever look into this at all?
Original comment by kyl...@gmail.com
on 31 May 2011 at 2:53
I went to the site this morning and it looks like they switched the site over
to flash. So if you have flash it appears to work.
Original comment by kdeko...@gmail.com
on 31 May 2011 at 1:54
[deleted comment]
I work for them, we still use Windows Media Player, you might have selected a
station that requires us to use their web player instead of our player.
Try this station:
http://tunein.com/radio/The-Ticket-1310-s35596/
Basically it runs like this for Firefox 4.0:
Windows Media Player (Default for WMA and mp3)
Flash (Fallback for mp3 stations if Windows Media Player isn't installed or the
plugin is disabled under media types)
Quicktime (Used for Quicktime streams or a fallback for mp3 if Flash isn't
installed)
For Real and AAC we present a link to download a playlist to the desktop since
the official Firefox Real Player plugin only associates itself with
audio/x-pn-realaudio-plugin and many versions of Flash have an annoying bug in
its builtin AAC decoders where it attempts to use some SSE exclusive
instructions on Athlon CPU's that have 3D Now extended but no SSE causing a
crash)
You can check the plugins used by clicking "Not Working" on the player and
"Check Media Support"
Original comment by kyl...@gmail.com
on 31 May 2011 at 6:59
The site is using features of Window Media player that gecko-mediaplayer does
not emulate, mainly some of the javascript functionality. If you could identify
the javascript methods you use, I may be able to emulate those.
The WMP javascript interface is quite large
http://msdn.microsoft.com/en-us/library/dd564034%28VS.85%29.aspx and since many
sites don't use but 10% of this interface it would be nice to minimize the
amount of work needed.
Original comment by kdeko...@gmail.com
on 31 May 2011 at 7:07
I'm contacting the other developers that maintain the player to offer input.
Is there any you can identify in the mean time? The player has its own volume
control so that might be a starting point.
Original comment by kyl...@gmail.com
on 31 May 2011 at 8:52
[deleted comment]
Here's what I got from them:
Scripting support is most important, followed by the event notification model.
Other functions we use:
play
stop
pause
volume
currentPosition
duration
getItemInfo("Title") - Current track name
getItemInfo("Bitrate")
The status codes to emulate would include:
0 Undefined Windows Media Player is in an undefined state.
1 PlaylistChanging New playlist is about to be loaded.
2 PlaylistLocating Windows Media Player is attempting to locate the playlist.
The playlist can be local (library or metafile with an .asx file name
extension) or remote.
3 PlaylistConnecting Connecting to the playlist.
4 PlaylistLoading Playlist has been found and is now being retrieved.
5 PlaylistOpening Playlist has been retrieved and is now being parsed and
loaded.
6 PlaylistOpenNoMedia Playlist is open.
7 PlaylistChanged A new playlist has been assigned to currentPlaylist.
8 MediaChanging A new media item is about to be loaded.
9 MediaLocating Windows Media Player is locating the media item. The file can
be local or remote.
10 MediaConnecting Connecting to the server that holds the media item.
11 MediaLoading Media item has been located and is now being retrieved.
12 MediaOpening Media item has been retrieved and is now being opened.
13 MediaOpen Media item is now open.
14 BeginCodecAcquisition Starting codec acquisition.
15 EndCodecAcquisition Codec acquisition is complete.
16 BeginLicenseAcquisition Acquiring a license to play DRM protected content.
17 EndLicenseAcquisition License to play DRM protected content has been
acquired.
18 BeginIndividualization Begin DRM Individualization.
19 EndIndividualization DRM individualization has been completed.
20 MediaWaiting Waiting for media item.
21 OpeningUnknownURL Opening a URL with an unknown type.
Original comment by kyl...@gmail.com
on 31 May 2011 at 9:15
play, stop, pause, currentPosition should have already been there
I just added '.settings.volume' to SVN
duration, getItemInfo still to be done.
Events might be a little tricky as I don't have all those events in my code, do
you really need all of those or are their certain ones you look for?
Original comment by kdeko...@gmail.com
on 31 May 2011 at 9:43
I'm not sure about events, I believe they are mostly just for feedback for the
stream monitor we use to calculate reliability of a stream, I'm double checking
with them.
Original comment by kyl...@gmail.com
on 31 May 2011 at 9:48
The key events are:
Connecting
Buffering
Playing
Error
Stopped
Those are there so the player knows if playback was succesful or if it failed
and it should move on to another stream or player.
I doubt we'll ever need the DRM events since the chances of mplayer getting DRM
from Microsoft is slim to none. Codec aquisition is irrelevant as it's FFmpeg
based or w32codecs which already has the needed codecs. However there might be
instances of older builds builds without WM Voice and WM Pro support, but
emulating the event specific to a codec not being available isn't a high
priority.
Original comment by kyl...@gmail.com
on 31 May 2011 at 10:06
Added media.duration event, but the site still doesn't work. I'll work on it
more tomorrow as I have time.
Original comment by kdeko...@gmail.com
on 31 May 2011 at 11:01
Can you provide a sample event handler, so I can be sure that I am issuing the
event in the proper method that you require. What I will do is put the event
handler into my sample website and ensure that the events are caught by the
handler.
Original comment by kdeko...@gmail.com
on 1 Jun 2011 at 1:02
I sent a request to see if they can get it for you.
Original comment by kyl...@gmail.com
on 1 Jun 2011 at 7:54
I was able to create a sample event handler, but from what I can tell from all
the websites the method I am using may not be the method that works in all
cases. So that is why I wanted to see what their code expected and from there I
can create the right events.
Original comment by kdeko...@gmail.com
on 1 Jun 2011 at 7:59
I'm still waiting for a response from them about it, is any of the code for
that in svn or are you still testing it locally?
Original comment by kyl...@gmail.com
on 1 Jun 2011 at 10:41
For the event code it is all local and actually only in html at this point.
Basically, the plugin just calls some javascript. So I can test the technique
without having to compile
Original comment by kdeko...@gmail.com
on 1 Jun 2011 at 10:51
Here's the links to some of the .js files used by the tuner:
http://tunein.com/assets/js/tuner/tunerCore.js
http://tunein.com/assets/js/tuner/tunerUI.js
http://tunein.com/assets/js/tuner/tunerDetect.js
Original comment by kyl...@gmail.com
on 2 Jun 2011 at 3:23
Ok, I committed some code to update the playState. However, it seems to fork
bomb the browser into oblivion. So something is still not right yet. The states
appear to be correct in the code, perhaps I just need to remove some of them. I
have committed the code to SVN so you can take a look at it. r447
Original comment by kdeko...@gmail.com
on 2 Jun 2011 at 12:46
Maybe the states get confused because of how mplayer decides what protocol to
use. i.e. While Windows Media Player silently transfers between RTSP, MMSU,
MMST and MMSH, mplayer basically starts over as it transfers between protocols.
Original comment by kyl...@gmail.com
on 2 Jun 2011 at 8:08
I'm not an expert in coding so I don't know how to do this from scratch, but if
that is the case, maybe you can have it send the state after mplayer finally
determines which protocol it's going to use and buffering begins.
Original comment by kyl...@gmail.com
on 2 Jun 2011 at 8:21
I'm pretty sure the problem is with STATE_READY, if I disable all of those the
fork problem goes away. There are three of them in the code right now, all look
valid from the plugin perspective. So I'll just have to figure out where to put
it. Right now the code loads the plugin and the website never sends the plugin
the URL to load.
Original comment by kdeko...@gmail.com
on 2 Jun 2011 at 8:30
I don't know if it's related to the existing state bug, but the value on the
volume control remains at 100 no matter where it's set.
Original comment by kyl...@gmail.com
on 2 Jun 2011 at 11:24
ok, while I have not tested the site yet this morning I have made some changes
to gecko-mediaplayer and gnome-mplayer that should implement all the features
you said you needed. So please pull SVN and then test with the attached html
page.
Original comment by kdeko...@gmail.com
on 3 Jun 2011 at 1:28
Attachments:
Also, do you have any idea why the site creates two instances of windows media
player? I just checked the site and it still doesn't work.
Original comment by kdeko...@gmail.com
on 3 Jun 2011 at 1:33
I didn't have a chance to test yet, but can you hover over the status section
where it says "playing" to see if it says VLC or Windows Media Player. It might
be attempting to use gecko-mediaplayer's VLC plugin emulation before it gets to
the Windows Media emulation.
Original comment by kyl...@gmail.com
on 3 Jun 2011 at 3:01
It says Windows Media Player (playing) when I hover over the word PLAYING
Original comment by kdeko...@gmail.com
on 3 Jun 2011 at 4:44
I don't know exactly why it would be loading twice. One possibility:
We pass the stream as a playlist file called listen.steam, for windows media
player this is layed out as an .asx file, so it would need to parse the
playlist and then the stream within it in KTCK's case.
However some stations require .asx parsing to occur on the user's end. BBC
Radio 1 is an example since they use their asx file to decide which stream to
deliver you based on if you are in or out of the UK. So you get our
listen.stream playlist that contains the .asx file from BBC's site which then
contains the root stream their server chooses to deliver you.
You can see the listen.stream URL that would be sent to the player by viewing
the source of the player that pops up:
http://tunein.com/tuner/?StationId=35596&
Does the plugin have a debugging option that can output extra info if I launch
Firefox from a terminal?
Original comment by kyl...@gmail.com
on 3 Jun 2011 at 5:13
Enabled verbose debugging in gnome-mplayer, Under Edit->Preferences->Interface
and then start firefox from a terminal and you should get lots of information.
gecko-mediaplayer has an ASX parser built into it, you can just hand it an ASX
file and it will process it correctly.
If you are using the playlist functionality of Windows Media Player, then I may
need to add more customizations to the code.
Original comment by kdeko...@gmail.com
on 3 Jun 2011 at 5:17
One thing that might be helpful would be a screen shot of the test2.html file
on a windows box. So we can compare what windows is doing vs firefox. I'll see
if I can find a windows box around here that I can use. Almost all my machines
are Linux.
Original comment by kdeko...@gmail.com
on 3 Jun 2011 at 5:19
I have windows on my other PC, is there anything specific you need or just the
log of status codes?
Original comment by kyl...@gmail.com
on 3 Jun 2011 at 5:45
Well I did a test in Windows and got the playStateChange output,
gecko-mediaplayer is different than what Windows Media Player is giving for the
states. but I did find that with Windows Media Player no state is emitted until
the media starts playing, which if your code depends on a state change to load
the first URL, well I'm confused how that works.
Original comment by kdeko...@gmail.com
on 3 Jun 2011 at 5:55
The test2.html file uses a quicktime movie as it's video src, which can be
played in windows media player with the right codecs and splitters. Did you try
it with an actual windows media file or stream too?
Original comment by kyl...@gmail.com
on 3 Jun 2011 at 6:11
Updated test2.html which uses a wmv file
I have also updated SVN to align the events closer to WMP on windows.
Original comment by kdeko...@gmail.com
on 3 Jun 2011 at 6:22
Attachments:
It's still not working with svn. Did you have a look at the html source for the
player page too? It has some additional javascript commands and might give you
an idea of what would trigger the "listen.stream" Url listed under "Streams" to
be sent to the plugin.
There's also some javascript urls at the top of the page, but I'm not sure if
they're related to the actual plugin functions or just layout related:
http://www.tunein.com/assets/js/modernizr-1.7.min.js
http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js
http://www.tunein.com/assets/js/json2.js
http://www.tunein.com/assets/js/jquery.cookie.js
http://www.tunein.com/assets/js/jquery.metadata.js
http://www.tunein.com/assets/js/jquery.tabify.js
http://www.tunein.com/assets/js/jquery.tinycarousel.min.js
http://www.tunein.com/assets/js/collide.js
Original comment by kyl...@gmail.com
on 5 Jun 2011 at 5:36
Well I did some more work on this, and I still can't seem to make it work. I
added a few more methods and properties and I believe I now have full coverage
of the API that is used by your player. And after all that it still doesn't
work. I'm just not sure what I am missing at this point.
Original comment by kdeko...@gmail.com
on 6 Jun 2011 at 6:55
Just to verify, where are we at now? The plugin loads but the listen.stream
file never gets sent to the plugin? Or does it get sent but playback never
begins?
Original comment by kyl...@gmail.com
on 6 Jun 2011 at 7:10
As far as I can tell, the javascript never sets tells the plugin what URL to
load. And the plugin appears to be loaded twice.
Original comment by kdeko...@gmail.com
on 6 Jun 2011 at 7:37
[deleted comment]
I sent another message asking if they can point out what specific code/events
triggers the sending of the url to the plugin.
Original comment by kyl...@gmail.com
on 6 Jun 2011 at 7:45
Here's the response:
"The tuner page defines a JSON structure with the available streams. It is
triggered down the chain by a window.onload event in tunerUI.js."
Original comment by kyl...@gmail.com
on 6 Jun 2011 at 8:20
We might have found something that might point out where it's happening, but
since you're familiar with the code of the actual plugin, in the mean time you
might be able to figure out where in your code this would need to be addressed:
Try playing the stream with the following url to see the log:
http://tunein.com/tuner/?StationId=35596&debug=1
Original comment by kyl...@gmail.com
on 6 Jun 2011 at 8:50
That is interesting... couple of things that bother me
1. It says that the player is not scriptable, it should be.
2. Not sure where the Connecting state is coming from gecko-mediaplayer doesn't
emit it
14:55:55.847 Browser: Firefox 4.0
14:55:55.847 Plugins: linux firefox 4.0 windows 7.0s, quicktime 7.6.9s, flash
10s, flash9 10s, flash8 10s, iframe 1.0, link 1.0,
14:55:55.848 Slider base offset: 22
14:55:55.849 Slider base offset: -199998
14:55:55.849 setTarget(undefined,35596,undefined,undefined,undefined)
14:55:55.850 Stream monitoring stopped
14:55:55.851 rank for Windows Media Player is 1
14:55:55.882 Player is not scriptable. Can't monitor
14:55:55.884 Element not found (tryNextEXT)
14:55:55.885 Element not found (tunerActions)
14:55:56.317 onstatechange: flash8: 1: 1 Stopped
14:55:56.364 flash object is ready
14:55:56.365 ready undefined
14:55:56.371 status 1
14:55:56.379 onstatechange: windows: 2: 2 Connecting
14:56:01.366 onstatechange: windows: 3: 3 Playing
Original comment by kdeko...@gmail.com
on 6 Jun 2011 at 8:59
I see why it is not scriptable...
this._scriptable = (object.versionInfo != undefined) && (object.controls !=
undefined);
I'm pretty sure I can fix that.. give me a few minutes
Original comment by kdeko...@gmail.com
on 6 Jun 2011 at 9:09
It uses a timer to poll the status at certain intervals if it didn't detect
scripting, I asked them what it uses to detect scripting if your fix doesn't
work.
Original comment by kyl...@gmail.com
on 6 Jun 2011 at 9:17
Ok, I got it to detect scripting, was quite easy... debug output is now...
Lot of errors about "this._object.controls is undefined" but it should be and
controls is defined on my test page. So I'm going to dig into _getNowPlaying
and see what is going on.
15:16:23.809 log created
15:16:23.816 Configuration loaded
15:16:23.817 OS: Linux
15:16:23.818 Browser: Firefox 4.0
15:16:23.818 Plugins: linux firefox 4.0 windows 7.0s, quicktime 7.6.9s, flash
10s, flash9 10s, flash8 10s, iframe 1.0, link 1.0,
15:16:23.819 Slider base offset: 22
15:16:23.820 Slider base offset: -199998
15:16:23.821 setTarget(undefined,35596,undefined,undefined,undefined)
15:16:23.822 Stream monitoring stopped
15:16:23.823 rank for Windows Media Player is 1
15:16:23.837 OnDSPlayStateChangeEvt: 3
15:16:23.840 onstatechange: windows: 3: 1 undefined
15:16:23.880 windows._getNowPlaying failed with Error: Error calling method on
NPObject!
15:16:23.883 windows._play failed with Error: Error setting property on
NPObject!
15:16:23.885 Stream monitoring started
15:16:23.886 Element not found (tryNextEXT)
15:16:23.887 Element not found (tunerActions)
15:16:24.280 onstatechange: flash8: 1: 1 Stopped
15:16:24.282 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:24.290 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:24.291 onstatechange: windows: 0: 0 undefined
15:16:24.292 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:24.294 flash object is ready
15:16:24.295 ready undefined
15:16:24.301 status 1
15:16:24.834 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:25.339 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:25.836 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:26.337 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:26.839 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:27.340 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:27.836 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:28.335 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:28.835 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:29.336 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:29.338 onstatechange: windows: 0: 0 undefined
15:16:29.339 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:29.835 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:30.335 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:30.836 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:31.347 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:31.834 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:32.336 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:32.835 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:33.336 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:33.836 windows._getNowPlaying failed with TypeError:
this._object.controls is undefined
15:16:33.886 Playback doesn't start
15:16:33.887 windows error
15:16:33.888 windows._getError failed with TypeError: this._object.error is
undefined
15:16:33.889 windows error: undefined
15:16:33.890 windows._getError failed with TypeError: this._object.error is
undefined
15:16:33.891 Trying next pair, current 0
15:16:33.892 Stream monitoring stopped
15:16:33.892 windows._stop failed with TypeError: this._object.controls is
undefined
15:16:33.893 tryRaw()
15:16:33.894 windows._stop failed with TypeError: this._object.controls is
undefined
15:16:33.895 setTarget(,,,,raw=true)
15:16:33.895 Sending request:
http://tunein.com/tuner/tune/?StationId=35596&open=true&raw=true
15:16:33.956 windows._stop failed with TypeError: this._object.controls is
undefined
15:16:33.959 Element not found (tryNextEXT)
15:16:34.335 onstatechange: windows: 1: 1 Stopped
Original comment by kdeko...@gmail.com
on 6 Jun 2011 at 9:22
Ok the page is detecting WMP 7 as the generated page is outputing
<embed id="radiotime_windows_player" type="application/x-ms-wmp" height="1"
width="1">
Looks to me like something is failing in the javascript and it is switching to
flash mode.
I'll go ahead and commit my code so that you can see what I am seeing.
Original comment by kdeko...@gmail.com
on 6 Jun 2011 at 9:47
Can you test it with the flash plugin disabled?
Original comment by kyl...@gmail.com
on 6 Jun 2011 at 9:50
I just tested with the latest svn, and got a crash.
Original comment by kyl...@gmail.com
on 6 Jun 2011 at 9:55
Original issue reported on code.google.com by
kyl...@gmail.com
on 10 Feb 2010 at 2:09Attachments: