REST:stream.view - estimateContentLength not working

General discussions.

Moderator: moderators

REST:stream.view - estimateContentLength not working

Postby rich600 » Tue Jan 20, 2015 6:30 pm

Hi,

I'm trying to get an estimated content length from stream.view using the REST API.

Here's an example URL :

http://<myserver>:4040/rest/stream.view?v=1.8.0&c=me&u=me&p=enc:<me>&id=42418&estimateContentLength=true&format=mp3&maxBitRate=0

I've tried this with a maxBitRate of 160 too, to force transcoding, and still nothing. The track plays fine.

When I look at the response in the browser, there are no response headers, but I'm expecting a content-length header.

I'm using SS 5.1 (non-beta).

Anyone else got this issue?

Thanks
Rich
rich600
 
Posts: 141
Joined: Tue Aug 12, 2014 9:54 pm

Re: REST:stream.view - estimateContentLength not working

Postby rich600 » Wed Jan 28, 2015 10:16 pm

Anyone ?! :-)
rich600
 
Posts: 141
Joined: Tue Aug 12, 2014 9:54 pm

Re: REST:stream.view - estimateContentLength not working

Postby rich600 » Wed Jan 28, 2015 10:22 pm

I notice that when I put the URL into safari, although it downloads the video, it cannot estimate the size of the download - just showing ?

Looks like a bug.

Cheers
Rich
rich600
 
Posts: 141
Joined: Tue Aug 12, 2014 9:54 pm

Re: REST:stream.view - estimateContentLength not working

Postby acroyear » Fri Jan 30, 2015 3:00 pm

I commented on the API pages at Google Groups.

I found that same problem of not getting content length when coming from the Fire Stick (but I *do* get it when coming from Desktop Chrome). It turns out that (at least in 5.0), the audio tag and/or audio player needs to send the "Range:" header in order for subsonic to return the content length tags. If you omit the range, it omits the content length and I can't find any way to resolve that without going into the source codes.

Whether or not html5 audio sends the Range is extremely browser-specific...and sometimes broken. It *was* working in Chrome 38 and 39 for Android, for example, but has stopped working in 40. It doesn't in the bundled browser for Android 4.2 but does in Android 4.4.I'm having no problems that I know about on Firefox (or Thunderbird) at this time.

There is no way to override the html5 audio tag's behavior in this to force it to send the header.
--
Joe Shelby
http://subfiresuite.com/
http://subfireplayer.net/
User avatar
acroyear
 
Posts: 779
Joined: Wed Mar 27, 2013 8:05 pm
Location: Northern, VA

Re: REST:stream.view - estimateContentLength not working

Postby acroyear » Fri Jan 30, 2015 3:01 pm

I can't speak for video. I have no need of it (I use plex for my video services).
--
Joe Shelby
http://subfiresuite.com/
http://subfireplayer.net/
User avatar
acroyear
 
Posts: 779
Joined: Wed Mar 27, 2013 8:05 pm
Location: Northern, VA

Re: REST:stream.view - estimateContentLength not working

Postby rich600 » Wed May 06, 2015 5:25 pm

Hi

thanks for the tip about the range. My player, when playing from the start, didn't send a range, so SS never sent back a content-length. I've changed it so that it sends a range of "0-" if playing from the start, and now the content-length is sent back correctly.

It would probably be better for SS to assume that no range effectively means "0-" and set the content-length appropriately.

Cheers
Rich
rich600
 
Posts: 141
Joined: Tue Aug 12, 2014 9:54 pm


Return to General

Who is online

Users browsing this forum: No registered users and 40 guests