ConnectSDK / Connect-SDK-Android-Core

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

Feature playlist #7

Closed oleksii-frolov closed 9 years ago

oleksii-frolov commented 9 years ago

I've added a new PlaylistControl interface and its implementation in DLNAService. Also there are still previous and next methods in MediaControl but they are changed to deprecated. Connectable device was a little bit refactored.

khk624 commented 9 years ago

I have 2 questions.

  1. Can't we just extend PlaylistControl from MediaControl?
  2. What do you think of changing (in MediaPlayer.java) public final static String Display_Video = "MediaPlayer.Display.Video"; public final static String Display_Audio = "MediaPlayer.Display.Audio"; public final static String Display_Playlist = "MediaPlayer.Display.Playlist"; to public final static String Play_Video = "MediaPlayer.Play.Video"; public final static String Play_Audio = "MediaPlayer.Play.Audio"; public final static String Play_Playlist = "MediaPlayer.Play.Playlist";
oleksii-frolov commented 9 years ago
  1. Yes, we can extend PlaylistControl from MediaControl, We discussed that with iOS team and they decided to have separate interfaces, but we can change it. The main reason to have separate interfaces is to show different responsibilities for them. Also we can assume that in future we will another interface like Equalizer and it should be added in the same way. When developer invokes playMedia() he receives an instance of MediaLaunchObject which contains two references for both interfaces
mMediaControl = object.mediaControl;
mPlaylistControl = object.playlistControl;

if PlaylistControl extends MediaControl we will have two similar links.

  1. It would be much better to rename Display to Play. But we have to support compatibility with current applications, for that we can create new constants and use them in SDK, and also leave old constants with Deprecated annotation. And we will remove all deprecated code in next release. IOS version has already had such names like MediaPlayer.Play.Video, so we should do that.