Luke 37144 Posted June 20, 2014 Share Posted June 20, 2014 For those who are not using our StreamBuilder library @@darwindeeds @@xnappo @@Redshirt (although you should eventually) The roku source code should now be considered the new model for which to extract sample code: https://github.com/MediaBrowser/MediaBrowser.Roku/blob/master/source/VideoMetadata.brs#L201 It supports all of the latest api features, including MediaSources, user-configured language preferences, channels, live tv and regular media. It does not yet support the new text subtitle api because that is not in the release server, but it soon will be. The most important thing about this code is what it uses to evaluate media info, as well as what it does not use. This code does not examine any of the following characteristics: LocationType VideoType IsoType Path Item type (e.g. movie, episode, channel item, live tv, etc) Your code should not be using this information either, except in direct play over the file system scenarios. If you follow these guidelines you will be able to play any content regardless of the source, and you'll be able to support user configuration. 3 Link to comment Share on other sites More sharing options...
im85288 1493 Posted June 20, 2014 Share Posted June 20, 2014 Luke I'm not sure if this is related to the changes you've made but I noticed now that some systems (eg Sonos playbar) does not accept DTS but will work fine with AC3. I hate to mention Plex but I recall there was an option on the server to say not to output DTS. I can see how to do this on the client but think maybe the option should be on the server as it is/was done in plex? Link to comment Share on other sites More sharing options...
Luke 37144 Posted June 20, 2014 Author Share Posted June 20, 2014 Different topic, different place. Link to comment Share on other sites More sharing options...
im85288 1493 Posted June 20, 2014 Share Posted June 20, 2014 Ok, is that sufficient as a FR or do you need more info? Is it something foreseen to do or out the question. Link to comment Share on other sites More sharing options...
chef 3749 Posted June 20, 2014 Share Posted June 20, 2014 (edited) Geez Louise! This Roku code looks like Visual Basic, but obviously it is bright script Edited June 20, 2014 by chef Link to comment Share on other sites More sharing options...
Luke 37144 Posted June 20, 2014 Author Share Posted June 20, 2014 yea it is a lot like VB 1 Link to comment Share on other sites More sharing options...
Koleckai Silvestri 1150 Posted June 21, 2014 Share Posted June 21, 2014 Basic is Basic... Brightscript is just a form of Basic as far as I understand it. Link to comment Share on other sites More sharing options...
Luke 37144 Posted June 21, 2014 Author Share Posted June 21, 2014 @@chef do i see some roku pull requests in your future? Link to comment Share on other sites More sharing options...
Luke 37144 Posted June 21, 2014 Author Share Posted June 21, 2014 Ok, is that sufficient as a FR or do you need more info? Is it something foreseen to do or out the question. feel free to create a topic Link to comment Share on other sites More sharing options...
Redshirt 1487 Posted June 21, 2014 Share Posted June 21, 2014 Man there's a never ending rabbit hole of model classes. Been converting the streambuilder to java. I really hope its worth it. Link to comment Share on other sites More sharing options...
Luke 37144 Posted June 21, 2014 Author Share Posted June 21, 2014 well i don't want you to convert, i want you to use them. so tell me what's preventing that so that you don't have to do that. is it just the serializable tag? also i have a couple recruits who may start some of the hand-coding for ApiClient. so they'll be able to do what's needed so that you can just use it. 1 Link to comment Share on other sites More sharing options...
Redshirt 1487 Posted June 21, 2014 Share Posted June 21, 2014 (edited) Some of these classes may be able to be stripped out as they won't be used by clients. But Issues that I can see. MediaBrowser.Model.ApiClient.GeneralCommandEventArgs cannot extend System.EventArgs MediaBrowser.Model.ApiClient.HttpResponseEventArgs cannot extend System.EventArgs MediaBrowser.Model.ApiClient.HttpResponseEventArgs cannot resolve System.Net.HttpStatusCode MediaBrowser.Model.ApiClient.SessionUpdatesEventArgs cannot extend System.EventArgs MediaBrowser.Model.Channels.ChannelFeatures new Integer() is not legal syntax MediaBrowser.Model.Channels.ChannelItemQuery new Integer() and new SortOrder() are not legal syntax MediaBrowser.Model.Configuration.ChannelOptions new Integer() is not legal syntax MediaBrowser.Model.Configuration.MetadataOptions Contains(string, StringComparer) method doesn't exist and StringComparers don't exist either MediaBrowser.Model.Configuration.NotificationOptions Same issues as 8 and also ToString() shouldn't be called on String based enums MediaBrowser.Model.Configuration.ServerConfiguration TimeSpan class doesn't exist in java. Why not hard code 5 * 60 or 300 MediaBrowser.Model.Dlna.AudioOptions Same as 5 MediaBrowser.Model.Dlna.ContentFeatureBuilder trim() needs to be a string not a char. So " instead of ' MediaBrowser.Model.Dlna.DeviceProfile Same as 5. Also TrimStart() doesn't exist MediaBrowser.Model.Dlna.DlnaFlags SenderPaced property initialization is a long being passed into an int method. compilation will fail. MediaBrowser.Model.Dlna.DlnaMaps Cannot use | for FlagsToString method. Also cannot cast (long)flags MediaBrowser.Model.Dlna.EventSubscription AddSeconds() and java.util.Date.UtcNow don't exist MediaBrowser.Model.Dlna.Filter StringSplitOptions doesn't exist MediaBrowser.Model.Dlna.MediaFormatProfileResolver cannot return Object[]. Need to return something that implements java.lang.Iterable MediaBrowser.Model.Dlna.StreamBuilder i.getConditions returns an array which addAll() can't handle. needs to be something that is implements java.util.Collection MediaBrowser.Model.Dlna.StreamBuilder all calls to IsVideoConditionSatisfied. Cannot convert a Float to a Double. videoFrameRate. MediaBrowser.Model.Dlna.StreamInfo new Integer(), new Double(), new Long() are not valid syntax. MediaBrowser.Model.Dto.BaseItemDto cannot implement INotifyPropertyChanged MediaBrowser.Model.Dto.BaseItemDto new Integer(), new Float(), new Boolean(), new Long(), new Double(), new Video3DFormat(), new SeriesStatus(), new VideoType(), new IsoType() are not valid syntax MediaBrowser.Model.Dto.BaseItemDto System.DayOfWeek doesn't have a Java equivalent MediaBrowser.Model.Dto.BaseItemDto All uses of java.util.Date. Code will compile, but I don't think the strings received will actually convert to date objects. All date variables may need to be String instead MediaBrowser.Model.Dto.BaseItemDto MediaType enum shouldn't have Entities. in front of it. It should either be just MediaType.Video or MediaBrowser.Model.Entities.MediaType.VIdeo. MediaBrowser.Model.Dto.BaseItemPerson Same as 22 MediaBrowser.Model.Dto.ChapterInfoDto Same as 22 MediaBrowser.Model.Dto.ImageInfo Same as 5 MediaBrowser.Model.Dto.ImageOptions new Integer() and new Boolean() are not valid syntax MediaBrowser.Model.Dto.MediaSourceInfo new Integer(), new long(), new VideoType(), new IsoType(), new Video3DFormat(), new TransportStreamTimeStamp() are not valid syntax MediaBrowser.Model.Dto.UserDto new Double() isn't valid syntax MediaBrowser.Model.Dto.userItemDataDto new Double() and new Boolean() are not valid syntax I'll add more later. These issues are just the ones that causing compile to fail. I haven't yet identified any issues that will present at runtime, or classes that just weren't converted at all for whatever reason. Also, I haven't added line numbers because the issues are typically happening all over those files. Enums where you've assigned a numeric value to each item are converted to java in a strange fashion. Have a look at how MediaBrowser.Model.Library.PlayAccess is converted and how it's referenced in BaseItemDto. If there's no number you can do something like if (playAccess.equals(PlayAccess.Full)). Which is a lot more readable than if (playAccess.equals(getPlayAccess().values()[0]) Edited June 21, 2014 by Redshirt Link to comment Share on other sites More sharing options...
Redshirt 1487 Posted June 21, 2014 Share Posted June 21, 2014 Actually looking into the json de-serializer that I'm using, it looks like I can specify the date format to use when encountering any date strings. So that means #25 may not be an issue at all. Link to comment Share on other sites More sharing options...
Luke 37144 Posted June 21, 2014 Author Share Posted June 21, 2014 ok, we're going to start withing with it by hand, so that stuff will all get resolved. Link to comment Share on other sites More sharing options...
im85288 1493 Posted June 22, 2014 Share Posted June 22, 2014 feel free to create a topic No problem, I've added it to my client preferences instead. Link to comment Share on other sites More sharing options...
chef 3749 Posted June 22, 2014 Share Posted June 22, 2014 @@chef do i see some roku pull requests in your future? It would be nice to help code something that works I would also have to but a Roku. I will let you know when I am set up. 1 Link to comment Share on other sites More sharing options...
darwindeeds 356 Posted July 1, 2014 Share Posted July 1, 2014 Luke, when you handle the audio track picker how do you decide which one is the default to pick (when the user starts the playback)? I assume you want pick the one that is optimal for direct play, correct? What if the audio track apt for direct play is of different language from the user's default language? Link to comment Share on other sites More sharing options...
darwindeeds 356 Posted July 1, 2014 Share Posted July 1, 2014 Thanks Luke. I thought I looked at it, will go through it again. Link to comment Share on other sites More sharing options...
Luke 37144 Posted July 1, 2014 Author Share Posted July 1, 2014 Actually media sources have a DefaultAudioStreamIndex and DefaultSubtitleStreamIndex property. Use those as they take care of all of that, including user language preferences. Take a look at the Roku source code. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now