Giter VIP home page Giter VIP logo

serenity-android's Introduction

Serenity for Android

Build Statuscodecov Sonar Qube: SonarQube

Plex Media Server support is now Deprecated!!! Please consider using Emby Media Server instead if you want to use Serenity.

Serenity for Android is a client for the Emby Media Server, Plex Media Server support is no longer actively maintained.
Serenity is not associated with Emby or Plex, Inc. If you value the Emby or Plex Media Server, consider donating to the respective project to help fund continued development.

Features

What does this support

  • Browsing existing TV Show and Movie Libraries
  • Playing back Movies and TV Shows
  • Browsing by Genre for TV Shows and Movies
  • Browsing by Season for TV Shows
  • Android TV and Fire TV devices running Android 4.1 or higher
  • Playback videos from Queue
  • Optional to playback movie trailers and episode previews from YouTube.
  • Multiple views, from Grid View to Detail View.
  • Auto discovery and works with all Plex 9 Media Servers, no server restriction.

What is currently not targeted:

  • Photo Browsing
  • Live TV Channels
  • Music

With this said, this is an open source project, so if the community wants to contribute code it will be welcomed. Feature requests and bug reports can be opened on the issue tracker.

Plexapp REST Library (Deprecated)

This project includes a module that provides READ access to the plex media server REST API. It can be use outside of the serenity application by others developers to access the metadata provided by a Plex Media Server. The code is licensed under an MIT License.

What open source license is this using?

The project is using one of the more liberal open source licenses available. MIT.

http://opensource.org/licenses/MIT

Yes this means anybody can fork the project, and try to do their own client. Commercial opportunities though will be limited since the app will more than likely use the free Transcoder KEY that PlexApp provides. Any commercial resell of an app that uses the transcoder features of Plex needs a special key from Plex. Thus one of the reasons this project is open source and will probably stay free in the play store once it is released there.

How can I help?

If you are a programmer, fork the project, and provide patches or enhancements via pull requests. If you don't have coding skills, but have graphic design skills, the project can always use a Logo, Icons, etc. Otherwise, file bugs, and open enhancement requests. I'm looking into various ways for donations to be sent to help the project along as well. The app will probably be free in the playstore.

Building from Source

Make sure to set the ANDROID_HOME environement variable to the location where your SDK is deployed.

To build the APK and APKLibraries from the command line:

./gradlew clean assembleDebug

The application APK will be in serenity-app/build/outputs. You can sideload this APK on your Android TV or Fire TV device.

Open Source Projects:

This project uses several open source projects and source code:

  • Simple (http://simple.sourceforge.net/) - provides a nice interface to Serialize and Deserialize XML information.
  • Toothpick
  • Retrofit 2
  • OkHttp 3
  • Android Priority Job Manager
  • GreenRobot EventBus
  • Glide v4

Unit Testing Frameworks

Skins

Some layouts are influenced by the following skins. Some icons reused from the Influence skin for XBMC

  • Aeon
  • MediaStreamer
  • Influence

serenity-android's People

Contributors

alonalbert avatar evanmcewen avatar kingargyle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serenity-android's Issues

Implement basic Anymote Protocol support

Leveraging the java-anymote library from Entertainlion, add in the ability for the tablets to send url intents to the device. This is only necessary for Tablets, and should be implemented as an IntentService so it runs in the background and not on a UI thread.

Handle Anamorphic Video content

There are cases like the DVD version of the Avengers which is an anamorphic encoded video, where it's stored size is 720 x 480. The problem when calculating the aspect ratio, is that it comes out to 1.5 instead of the anamorphic 1.78. The android media player doesn't report the Display size only the stored size of a video.

Plex Media server correctly records the aspect ratio as 1.78. So need to compare the two, if there is a difference being report, then use the Plex reported aspect ratio to help size the video correctly.

Add Main Menu OnDeck and Recently Viewed Widgets

A simple display of recently viewed Video content and items that are OnDeck should be displayed above the main menu bar. This should change based on the Menu item choosen. If a menu item doesn't support recently viewed/ondeck, these items are hidden.

Support Transcoding HLS streams from Plex

There is a special URL and some extra keys that need to be used in order to get a stream that transcodes from audio/video to another format. Most of this is documented here:

http://forums.plexapp.com/index.php/topic/22303-plex-transcode-api/

Also see the Roku Plex client source as well.

https://github.com/kingargyle/roku-client-public/blob/master/Plex/source/PlexMediaServer.brs

Using both resources one should be able to get back a M3U8 file for the HLS streaming.

Errors when connecting to Movies and TV

I'm using the latest version of Serenity on a Hisense Pulse Google TV. I've entered the proper server address (confirmed by connecting to Plex web client), but when I try to browse movies I get a message indicating that Serenity is unable to communicate with the server for the reason that the elmenet Media is declared twice at line 79. When I try to browse TV shows, Serenity force closes immediately. Below are the bug files (I've redacted the machine identifier and other personal information).

From the /servers URL:

          <MediaContainer size="1">
                <Server name="myplex" host="XXX" address="192.168.2.8" port="32400" machineIdentifier="XXX" version="0.9.7.12.407-db37d6d"/>
          </MediaContainer>

From the Library/Sections URL:

        <MediaContainer size="3" allowSync="0" identifier="com.plexapp.plugins.library" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1358288594" title1="Plex Library">
            <Directory art="/:/resources/movie-fanart.jpg" filters="1" refreshing="0" thumb="/:/resources/movie.png" key="1" type="movie" title="Movies" agent="com.plexapp.agents.imdb" scanner="Plex Movie Scanner" language="en" uuid="2d824c10e8dc7f3f84362a2851e041c8ea2a4140" updatedAt="1359756605" createdAt="1320001782">
                <Location path="/Volumes/USB_Storage/Movies"/>
            </Directory>
           <Directory art="/:/resources/artist-fanart.jpg" filters="1" refreshing="0" thumb="/:/resources/artist.png" key="3" type="artist" title="Music" agent="com.plexapp.agents.lastfm" scanner="Plex Music Scanner" language="en" uuid="3f5d6b0571e3a491ed03bae6595ba35afb4b064a" updatedAt="1357542503" createdAt="1357541658">
                <Location path="/Volumes/iMac/Users/XXX/Music/iTunes/iTunes Media/Music"/>
           </Directory>
           <Directory art="/:/resources/show-fanart.jpg" filters="1" refreshing="0" thumb="/:/resources/show.png" key="2" type="show" title="TV Shows" agent="com.plexapp.agents.thetvdb" scanner="Plex Series Scanner" language="en" uuid="032214e4a74e0db2d9812a21d6af3617a731de08" updatedAt="1359670205" createdAt="1320001782">
              <Location path="/Volumes/USB_Storage/TV"/>
           </Directory>
        </MediaContainer>

Image Loading Performance

Need to pre-cache the images when the app starts up. Particularly for the background images in the movie browsing section. Also should put any loading of an image on the background thread.

Force Close: OSD with NPE

java.lang.NullPointerException
at com.novoda.imageloader.core.file.BasicFileManager.getFile(BasicFileManager.java:83)
at com.github.kingargyle.plexappclient.core.imageloader.OSDImageLoader.run(OSDImageLoader.java:67)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
at java.lang.Thread.run(Thread.java:1020)

Video PodCast browser by RSS feed

Some web sites actually play nice with the web. In particular, PBS.

http://www.pbs.org/wgbh/nova/sciencenow/rss/

Science now provides RSS feeds that can be parsed and the URL to the video can be retrieved. As a proof of concept should try to add support for the NOVA vodcast, which contains the appropriate information. If possible integrate it using the existing MovieBrowser format.

This will entail creating a new VideoContent service, that parses out and populates the appropriate information for the browser. Not all items may be there, but the important direct play url should be available.

Category Filtering for Episodes

Episodes need special handling for content that is returned. Plex mixes formats between Shows and Episodes so need to handle episodes specially.

Refactor MediaController and Video Player

There are a couple of problems that need to be addressed:

  1. Progress is not updated when using the OnScreen controls for skipping Forward or Backward.
  2. Code is handled in both places for keyboard events, however only the Video Player code is executed.
  3. MediaController currently doesn't get focus when shown. This needs to be addressed so that it's keyboard events can be processed as well as touch events. Need to let the mediacontroller be focasable.

This needs to be fixed before going to 1.0.0 Beta.

Refactor the Info screen

Need to do a slight re-arrangement on the info screen. Add movie poster, and move title and summary information around.

Add option to clear disk cache.

For Google TV devices add an option to clear the disck cache. If other devices have a menu key they can get to it as well.

Add Ability to Pin Content to Device for Offline Viewing.

The simpliest method is to pass to a download manager the ability to download a URL to an external storage location that is publicly accessible outside of the app. Users can then use an external media player to play the content.

IP Address Issues

I cannot get past the "settings" stage upon install. I have read the wiki and have tried various IP addresses and ports with no resolution. I am sure my issue is a configuration issue rather than a coding issue with the program, but I need help to resolve it. I am using a home network (cisco router). Plex web address on my network appears in my web browser as http://127.x.x.x:34200/web which will not work on another computer on my network, however http://192.168.x.x:34200/web DOES work (but not on Serenity). I hope that narrows down the issue somewhat. Thanks in advance!

Add ability to Display subtitles if they exist.

By leveraging code from the subTitleConvertor project, serenity could read and display subtitles from a variety of formats.

Use of the player's current position could be used to determine when to display subtitle, and for how long.

This is mainly needed for Google TV devices and versions of android before 4.2. 4.2 on wards has the ability to natively read and display .srt files.

Add Category Filtering support to TV Shows

Similar functionality for TV Show (Banners) browsing, one can narrow the shows down by Genre, Newest, Recently Added, etc. This may need some rework of this screen due to the need to allow for the placement of the Category and Secondary Filters.

Increase Font Size

Right now, when I go to watch Young Justice, I have to scroll thru EVERYTHING with new episodes to find it. Or worse if I want to watch an episode I've already seen.

I'd love to hit they "Y" key on my revue's keyboard and jump straight the Y's. Would be great.

I know you have "view by first letter" but it has a couple of downfalls for our use:

  1. It ONLY lists shows for that letter, you can't move beyond the Y's to the Z's for instance.

  2. It shows ALL shows, not just unwatched ones.

Also: PLEASE increase the fonts sizes!!! At least as an option.

And, having a sidebar list of small posters/names of all your shows/movies for that subsection (all/unwatched/Alpha) in any selection screen would be helpful for those of us with lots of shows.

Thanks. :)

Add enhanced support for Quick Navigation

People with large libraries need a way to quickly navigate through the library.

Some suggestions:

  • Enable Pg/Pg down keys to skip through the gallery 10 at time or allow for user configuration.
  • Enable a Filter menu option that would filter down the current list to the available items entered in from the keyboard.
  • Enable quick skipping by pressing a letter on the keyboard (only applicable to google tv or devices with a keyboard connected).

Only see settings menu

Trying to access server called media on 192.168.1.12. Using logitech revue. Web app works ok.

When returning to an OnDeck view have option to remove just watched video

When returning from watching a video, user should have a preference option to allow the removal of the video from the list. Ideally the list would automatically refresh with the next on deck item. So maybe have a "Always Refresh On Deck" option in the preference so that Plex automatically provides the next in the list.

Implement Resume functionality

Along with the progress functionality, the ability to Resume a video needs to be implemented. In plex this is captured by the viewOffset attribute for a video.

      rating="9" viewOffset="18181" year="1999"

The viewOffset is stored in milliseconds from the beginning of the file.

the seekTo method of the media player takes milliseconds so this should be a straight pass through to set the new position.

Refresh metadata of selected item once video is done playing

Once a video is done playing and control has been returned to the browser activity. Need to update the currently selected item's meta data in the background. This is needed to get the updated Watched flag and the Progress information in case a user goes directly back to playing the video.

StringOutOfBound Exception when browsing TV Shows

Reported through BugSense.

java.lang.StringIndexOutOfBoundsException: length=0; regionStart=0; regionLength=-1
at java.lang.String.startEndAndLength(String.java:583)
at java.lang.String.substring(String.java:1464)
at com.github.kingargyle.plexappclient.ui.browser.tv.TVShowBannerOnItemSelectedListener.createTVShowDetail(TVShowBannerOnItemSelectedListener.java:127)
at com.github.kingargyle.plexappclient.ui.browser.tv.TVShowBannerOnItemSelectedListener.onItemSelected(TVShowBannerOnItemSelectedListener.java:100)
at android.widget.AdapterView.fireOnSelected(AdapterView.java:892)
at android.widget.AdapterView.selectionChanged(AdapterView.java:879)
at android.widget.Gallery.selectionChanged(Gallery.java:561)
at android.widget.AdapterView.checkSelectionChanged(AdapterView.java:1043)
at android.widget.Gallery.setSelectionToCenterChild(Gallery.java:607)
at android.widget.Gallery.trackMotionScroll(Gallery.java:402)
at android.widget.Gallery.onScroll(Gallery.java:1043)
at android.view.GestureDetector.onTouchEvent(GestureDetector.java:572)
at android.widget.Gallery.onTouchEvent(Gallery.java:958)
at android.view.View.dispatchTouchEvent(View.java:7246)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2168)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1903)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1953)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1405)
at android.app.Activity.dispatchTouchEvent(Activity.java:2410)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1901)
at android.view.View.dispatchPointerEvent(View.java:7426)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3220)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3165)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4292)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4271)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4363)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:171)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4342)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4382)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:530)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)

Force Close: IllegalStateException with OSD

java.lang.IllegalStateException
at android.media.MediaPlayer.getCurrentPosition(Native Method)
at com.github.kingargyle.plexappclient.ui.video.player.SerenitySurfaceViewVideoActivity$SerenityMediaPlayerControl.getCurrentPosition(SerenitySurfaceViewVideoActivity.java:378)
at com.github.kingargyle.plexappclient.ui.video.player.MediaController.setProgress(MediaController.java:442)
at com.github.kingargyle.plexappclient.ui.video.player.MediaController.access$200(MediaController.java:75)
at com.github.kingargyle.plexappclient.ui.video.player.MediaController$1.handleMessage(MediaController.java:428)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4196)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)

Update Progress Information

A special url is used to update progress information on the plex media server for a video/tv show.

/:/progress?key=2288&identifier=com.plexapp.plugins.library&time=77357

Where key is the metadata key for the item, and time is the new position in milliseconds.

Filter for Unwatched correctly filters Seasons but not Episodes with the Season

library/metadata/166/allLeaves?unwatched=1

The key there should always return Unwatched episodes only. Choose a small set of episodes, i.e. FireFly, and watch a few episodes. Go back to the TV Show Browser, select the category Unwatched. Should show FireFly, browse into the FireFly, and then select All Episodes. That should only display unwatched episodes, if it is display all episodes, there is a bug.

This was reported on the Google+ page for serenity so should be part of a bug fix release. Targeting for 0.9.1

Set Watched/Unwatched status

There is a special url and format that needs to be called to set the watched and unwatched status for TV Shows and Movies.

From the Plex Developer's forums:

You can changed the watched/unwatched status via following URL:

Set Watched: http://:32400/:/scrobble?key=&identifier=com.plexapp.plugins.library
Set UnWatched: http://:32400/:/unscrobble?key=&identifier=com.plexapp.plugins.library

where the = the number from the key attribute return from PMS.

eg if key for a movie was /library/metadata/554 then =554

then use
Watched: http://:32400/:/scrobble?key=554&identifier=com.plexapp.plugins.library
UnWatched: http://:32400/:/unscrobble?key=554&identifier=com.plexapp.plugins.library

Add NetCasts option

NetCasts is a term coined by Leo Laporte of TWiT fame.

For Serenity, NetCasts will include a mixture of pre-defined channels, and user selected channels. Since the video portion of the app is already done, and we have a good basis around that, we'll concentrate first on providing Video support. This relates to issue the issue for adding RSS feed reading ability.

We may need to back this with basic information to start off with, like an XML file that contains the feeds that are always available. This should be enhanced with a simple SQLite database for user defined feeds and content.

Plex may not be supported, the main reason is the legal gray area that it it's channels option provides. So we want to try and stick to feeds that offer an RSS or ATOM feed format.

Information around supporting TWiT:

http://wiki.twit.tv/wiki/Developer_Guide

Users should have an option to choose which built in channels they see.

Add enhanced support for Tablets to share with Able Remote

http://ableremote.com/developers/

For tablets it would be nice to long press a poster in one of the browsers, and have this trigger a share to be played back on google tv using a supported player.

Eventually the VideoPlayer for Serenity needs to be able to respond to these intents, but to start with could send just the video url, and have Google TV use whatever player is capable of playing the video.

This should only be enabled if Able remote is installed on the device.

Auto Discover Plex Media Servers

There are multiple ways to discover plex media servers.

  1. Proprietary Plex UDP protocol.
  2. DLNA protocol
  3. Bonjour (deprecated in Plex).

The goal is to make it easier for new installations to get going. If the IP address is already known, then we don't need to auto discover. If it is NULL then try to auto discover using DLNA as the protocol. Will need to filter out all other DLNA servers for the time being.

Cling is an open source DLNA framework that already has built in Android support so will look at using this.

http://4thline.org/projects/cling/core/manual/cling-core-manual.html#chapter.Android

Keep the option to allow user to manually enter the ip address, they could have DLNA turned off.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.