ConnectSDK / Connect-SDK-Android-Core

Core source code for the Android Connect SDK project
Apache License 2.0
114 stars 79 forks source link

Airplay pin #39

Closed khk624 closed 9 years ago

khk624 commented 9 years ago

This will handle pin code for AppleTV

Steps to reproduce

  1. Go to Settings on AppleTV
  2. Go to AirPlay
  3. Security -> choose Onscreen code or Password
  4. Beam Image, Video, or Audio
oleksii-frolov commented 9 years ago

Why did you remove PersistentHttpClient? A playback of a long video is stopped after some time without "keep-alive" connection.

khk624 commented 9 years ago

It was not about keep-alive connection, it was more about HttpClient class issue. HttpURLConnection and Plain socket has no problem about the issue. (As I tested)

No special reason to remove PersistentHttpClient, but from my point of view, it's more simple, and better readability. I've tested long video many times.

khk624 commented 9 years ago

Just added getPlaybackInfo() in connect(), to work as other services. (When we click the devices, and if apple tv is using security pin or something, then it would open pin screen).

and merged dev branches.

@frolov-alexey if playing long video has no problem, please merge this branch to dev.

oleksii-frolov commented 9 years ago

I've tested a 30 minutes video http://bd-long-version.s3.amazonaws.com/472537.mp4 and it was stopped after 20 minutes but this is another issue, AirPlay service was removed and that's why video was stopped and It doesn't related to PersistentHttpClient.

04-13 12:19:33.453: D/(2168): AirPlay: send http://192.168.1.132:7000/scrub
04-13 12:19:33.485: D/(2168): AirPlay: response 200
04-13 12:19:48.454: D/Timer(2168): Timer
04-13 12:19:48.465: D/(2168): AirPlay: send http://192.168.1.132:7000/scrub
04-13 12:19:48.517: D/(2168): AirPlay: response 200
04-13 12:20:03.453: D/Timer(2168): Timer
04-13 12:20:03.454: D/(2168): AirPlay: send http://192.168.1.132:7000/scrub
04-13 12:20:03.487: D/(2168): AirPlay: response 200
04-13 12:20:12.380: D/Connect SDK(2168): onServiceRemoved: friendlyName: Apple TV (2)
04-13 12:20:12.384: D/2ndScreenAPP(2168): Device Disconnected
khk624 commented 9 years ago

Yes apparently it's another issue, zeroconfDiscoveryProvider somehow removed the service.

oleksii-frolov commented 9 years ago

OK, I am going to merge this. HttpUrlConnection works fine for AirPlay and I see PIN request during first connection to AirPlay