FAQ  •  Register  •  Login

Started a mediabrowser on iOS - some troubles

<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Sat Dec 08, 2012 10:52 pm

Started a mediabrowser on iOS - some troubles

Hi there,

I'm an iOS coder and a friend told me about Serviio. I'd like to be able to browse his serviio through an iPhone.
So we talk a little about that and I think I'll give it a try.

I've already contact Will. He helps me with docs and the way to start.

So I've run succesfully a ping call, through the CDS REstfull API.
And now, I'm trying the login process. And it's a little bit harder.

I've successfully generated the signature. And I'm calling cds/login with POST method with 2 parameters : signature and X-Serviio-Date (with the same date I used to compute the signature).

Problem : I got an undocumented response :-(
httpCode : 415

I must be wrong somewhere but I'm stalled right now...
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16742

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Dec 09, 2012 12:13 am

Re: Started a mediabrowser on iOS - some troubles

415 is Unsupported media. I think it happens when you don't send Content-Type header (application/xml or application/json, depending on the payload)
<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Sun Dec 09, 2012 8:49 am

Re: Started a mediabrowser on iOS - some troubles

Perfect, you were right :) Thxs.
My client framework send a "application/x-www-form-urlencoded" content type.
I'll serialized it to be able to send xml or json content type.

One more question : I understood that X-Serviio-Date must be added to HTTP header.
But what about the signature ?
I understood that I have to add it to the "Authorization" header.

So when I post my request, I haven't any param to pass through ? The 2 necessary params are in the HTTP header ? Am I right ?

Thxs
<<

will

DLNA master

Posts: 2122

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Sun Dec 09, 2012 9:31 am

Re: Started a mediabrowser on iOS - some troubles

Yes thats correct. For my login POST, I set the following headers (set up on my connection by doing setHeader(HEADER_NAME, HEADER_VALUE)):

  Code:
Accept: application/json
Accept-Charset: UTF-8
X-Serviio-Date: GENERATED_DATE
Authorization: GENERATED_SIG


On other point, generate the date using something like US date formatting, some other locales will work, but others won't.

Also make sure you use developer tools built into your webbrowser (or as a plugin), or something like http://hurl.it/ it will make things much quicker for the initial testing.
Will
Beta Tester Group
ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: More info

Player: Sony BDP S370 | Server: Debian 6.0 x86
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play
<<

Xmantium

User avatar

DLNA master

Posts: 1418

Joined: Sat Jul 23, 2011 2:12 pm

Location: Manchester, UK

Post Sun Dec 09, 2012 10:33 am

Re: Started a mediabrowser on iOS - some troubles

Looking forward to the completion of this app! Please please make it compatible with iPad.

Have you got plans to include your own player or use external player like ServiiGo?
Sony Bravia 2010 52NX803 - Sony PS3 - Xbox 360
Serviio running on QNAP NAS 639 Pro - 1.6 Intel Dual Core - 2GB RAM and QNAP NAS 121 - 2Ghz ARM Marvell - 1GB RAM
Console using ServiiDroid for Android, ServiiMetro and ServiiWP for Windows Phone and WebUI for iOS
<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Sun Dec 09, 2012 11:23 am

Re: Started a mediabrowser on iOS - some troubles

Cool thxs.
Of course, I'll keep you update about the app.
For the moment, I'm just making a proto for a friend.
But yes, I'll certainly release an app on the store and ok, I'll make a universal one (iPhone/iPad).
See you soon, for the next pb :)
<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Sun Dec 09, 2012 10:20 pm

Re: Started a mediabrowser on iOS - some troubles

Ok, thks to you, login is now ok. I got my magic token :)

So, I'm exploring now the browse API.

A the moment, I only have 1 question : I didn't really understand the profile_id argument. What is that ? When I test request with 0, I've got an HTTP 500, with 1, it's ok. With 2, too :-)


Thxs
<<

will

DLNA master

Posts: 2122

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Sun Dec 09, 2012 10:35 pm

Re: Started a mediabrowser on iOS - some troubles

It is the id of the profile (stored in profiles/application-profiles.xml on the server), which describe how to process files for a particular device / client application, ie transcode unsupported formats. 1 is a generic profile that does nothing, MediaBrowser uses 'flash_player', ServiiGo uses 'serviigo'. For now use 1, but you will need to write a dedicated profile (with our help) that maximises the files that can be played back under iOS in order to play back different types of video and audio files.
Will
Beta Tester Group
ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: More info

Player: Sony BDP S370 | Server: Debian 6.0 x86
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16742

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Dec 10, 2012 9:31 am

Re: Started a mediabrowser on iOS - some troubles

Re profile - Serviio cannot transcode to H264 / apple http ATM, so native playback of transcoded files will not be possible. You can still play H264/mov files natively, and the rest probably using a dedicated iOS player that can play those (eg 8Player).
<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Tue Dec 11, 2012 3:20 pm

Re: Started a mediabrowser on iOS - some troubles

Hi there.

Ok, in my proto, I can now browse through the differents folders thanks to the cds/browse API.
Now, I'm working on the audio player.

I've understood that I have to download the resource from the url I got previously with cds/resource API.
But when I'm downloading a mp3, it's a little bit long (I'm testing through 3G Internet). I've compared with ServiGo app and loading is much more faster.

So I'm wondering if there is a trick in ServiiGo ? Like asking resource for first 10 seconds of the resources for caching and asking for rest just after ?
No ?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16742

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Dec 11, 2012 3:37 pm

Re: Started a mediabrowser on iOS - some troubles

You can do range requests, for supported files (usually not transcoded), as described in the API docs. Other than that, from my experience, you just give an mp3 player component the URL (or Input stream from the URL) and it should start playing it as it gets the data - no need to download the full file first.
<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Tue Dec 11, 2012 3:46 pm

Re: Started a mediabrowser on iOS - some troubles

Oh yes, you must be right.

I'm just looking through a classic download and sure, through a player, with just the URL, the player will manage the stream automaticaly...

Good thing. Something I've not to build :mrgreen:

Thxs
<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Fri Dec 14, 2012 10:12 am

Re: Started a mediabrowser on iOS - some troubles

Hi there,

Ok, my iOS client progress is good.

I've got many questions to Will and zip :
=> how can I name my app ? At the beginning, I thought calling it ServiGo but I realized that the Go was for Google :) So, what do you think ? Is it better to call it like its grand sister on Android ? Or is it better to call it ServiOS ?
=> Similar question around the app Icon... Is it better to use the same as the Android application ? Or you don't mind...

I think I will release a first version with only audoi player and photos browser. The movie part is maybe less used and it's a really big part to manage on iOS... And first contacts with player developer are not very hot :)

Bye
<<

Xmantium

User avatar

DLNA master

Posts: 1418

Joined: Sat Jul 23, 2011 2:12 pm

Location: Manchester, UK

Post Fri Dec 14, 2012 3:08 pm

Re: Started a mediabrowser on iOS - some troubles

Hi LeChatNoir, with ServiiGo - i think it meant "Serviio on the Go" hence ServiiGo as users can use MediaBrowser on their mobile on the go

I think ServiiOS (Serviio + iOS) will be a great name for a Console control only app like ServiiDroid (Serviio + Android) and ServiiWP (Serviio + Windows Phone)

Unless your your also putting in Serviio Console control and mediabrowser all in one app, ServiiOS is a great name!

If the app is just for MediaBroswer, possible suggestions ServiiBrowser, ServiiOS Browser, ServiiAIR Play, ServiiPlay, ServiiPlayer, ServiiMedia
Sony Bravia 2010 52NX803 - Sony PS3 - Xbox 360
Serviio running on QNAP NAS 639 Pro - 1.6 Intel Dual Core - 2GB RAM and QNAP NAS 121 - 2Ghz ARM Marvell - 1GB RAM
Console using ServiiDroid for Android, ServiiMetro and ServiiWP for Windows Phone and WebUI for iOS
<<

will

DLNA master

Posts: 2122

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Fri Dec 14, 2012 5:29 pm

Re: Started a mediabrowser on iOS - some troubles

Definately use a different name and icon (to both ServiiGo and Serviio). Makes it easier for users and avoids confusing over branding/association of the addons and the different developers. My ServiiGo icon would also look very out of place on iOS.

Sounds like you are making excellent progress. Is there no way on iOS to send a message to the OS containing a link to a video and get it to find a suitable player.
Will
Beta Tester Group
ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: More info

Player: Sony BDP S370 | Server: Debian 6.0 x86
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play
<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Fri Dec 14, 2012 9:53 pm

Re: Started a mediabrowser on iOS - some troubles

Ok, I'll choose another name so. I'll certainly choose one of Xmantium :-)

About that :
Is there no way on iOS to send a message to the OS containing a link to a video and get it to find a suitable player.

I don't think it's possible... Each application is sandboxed... And applications can communicate through url schemes... But my knowledge is not illimited :-) I'll investigate. Under Android, you manage the case like this ?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16742

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Dec 14, 2012 10:55 pm

Re: Started a mediabrowser on iOS - some troubles

Is there not a built-in video player component? Obviously it'll be limited to mp4/h264/aac files for now.
<<

Xmantium

User avatar

DLNA master

Posts: 1418

Joined: Sat Jul 23, 2011 2:12 pm

Location: Manchester, UK

Post Fri Dec 14, 2012 10:57 pm

Re: Started a mediabrowser on iOS - some troubles

LeChatNoir it maybe possible, i do it all the with my daughters iPad... but its files stored locally... not sure it will work for streaming
I usually use FileBrowser to copy over video files to the iPad, then when i click on the file it says Open to, then lists the choices of Video players, i personally use CineXplayer as it plays all formats of files. Ive seen other apps that also has "Open up with..." the chosen app feature such as iDownloader

My daughters away till Xmas with my wifes family so cant show you screenshots.
Worst case scenario, there must be an open source video players for iOS that could be possibly built in to your app.
The hard part can be getting it approved by Apple. Its one of the reason i chose to stay away from Apple's locked down system.

About the name choosing, your welcome to use any of my suggestions.
I remember the rant Will, me and other forums users had for the Android console, finally i was glad Will eventually chosen ServiiDroid!!
Sony Bravia 2010 52NX803 - Sony PS3 - Xbox 360
Serviio running on QNAP NAS 639 Pro - 1.6 Intel Dual Core - 2GB RAM and QNAP NAS 121 - 2Ghz ARM Marvell - 1GB RAM
Console using ServiiDroid for Android, ServiiMetro and ServiiWP for Windows Phone and WebUI for iOS
<<

LeChatNoir

Streaming enthusiast

Posts: 23

Joined: Sat Dec 08, 2012 10:42 pm

Post Fri Dec 14, 2012 11:17 pm

Re: Started a mediabrowser on iOS - some troubles

Ok, I'll look at that... and keep you update.

I guess that this part is the hard part for me because video is an unknown domain for me...
I know the iOS standard API is limited about formats. Apple sells movies so I guess they're not interested on people paying mkv ^^
But as I said, I'm not very comfortable with this domain...

But it's the advantage of serviio no ? Serviio can encode movies before streaming ? Am I right ? So iOS users could setup their serviio to say : movie must be streamed in H.264 format for iOS.
No ?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16742

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Dec 14, 2012 11:52 pm

Re: Started a mediabrowser on iOS - some troubles

yes, but Serviio doesn't support transcoding to h264 yet
Next

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.