hpooni 6 Posted February 17, 2015 Posted February 17, 2015 Is it possible to use locally stored image in ChanneltemInfo for ImageUrl property? I've trying the following by embedding the resource but it doesn't seem to work. ImageUrl = GetType().Namespace + ".Images." + "MyImage" + ".png"
Cheesegeezer 3104 Posted February 17, 2015 Posted February 17, 2015 (edited) Is it possible to use locally stored image in ChanneltemInfo for ImageUrl property? I've trying the following by embedding the resource but it doesn't seem to work. ImageUrl = GetType().Namespace + ".Images." + "MyImage" + ".png" Where are you trying to get the image from? Is this specifically for a channel url (eg. Sky Sports 1, ESPN, HBO, etc) or just the main image for the channel If it's just for the Channel image, the use MB API, if you want to locally search you would need to add some configuration to your plugin and add some code in to allow retrieval for locally stored images Edited February 17, 2015 by Cheesegeezer
hpooni 6 Posted February 17, 2015 Author Posted February 17, 2015 Thanks for the reply. The image will for an item inside the channel. For example, add video item but provide a locally stored thumbnail for it. The example I provided is for retrieval of the channel image and I was hoping I could apply the same logic for retrieval of the item thumbnail. I would like to embed the images in the dll and use them as thumbnails for the channel items as needed.
Cheesegeezer 3104 Posted February 17, 2015 Posted February 17, 2015 Thanks for the reply. The image will for an item inside the channel. For example, add video item but provide a locally stored thumbnail for it. The example I provided is for retrieval of the channel image and I was hoping I could apply the same logic for retrieval of the item thumbnail. I would like to embed the images in the dll and use them as thumbnails for the channel items as needed. Well that should be easy enough if you are going to embed them in the plugin. Just reference your resource in your code. Create a folder in your solution explorer, where ever you want(under which logical hierachy) called Images. Then drag and drop your images into that folder. Then open resources and drag your images from your folder onto the resources blank space, this will embed them into your project dll. All you have to do then is reference them by doing something like this //Return an object from the image chan1.png in the project object O = Resources.ResourceManager.GetObject("chan1"); //Set the Image property of channelPic to the returned object as Image channelPic.Image = (Image)O; Hope that helps
hpooni 6 Posted February 17, 2015 Author Posted February 17, 2015 Ok cool thanks. I will play around with that to see if I can get it to work. Another quick question... Is there any way to always retrieve/build the item list in the channel (I'm developing) from the web instead of reading the cached ones. Perhaps, there's a way to invalidate the IDs each time?
Cheesegeezer 3104 Posted February 17, 2015 Posted February 17, 2015 Ok cool thanks. I will play around with that to see if I can get it to work. Another quick question... Is there any way to always retrieve/build the item list in the channel (I'm developing) from the web instead of reading the cached ones. Perhaps, there's a way to invalidate the IDs each time? There is always a way to do anything in code, it just depends on how easy that is. How does your channel work, is it always available, triggered to refresh from the scheduled tasks or when the channel is initiated by the user by clicking on the channel logo. Any of those ways you can add code to check the validity of your channel list. Probably a scheduled task refresh would be the most likely event you want to trigger to allow the list to be rebuilt from your sources on the web. either use the WebClient class or use the built in HttpRequest from MediaBrowser managed code to do the refresh, I personally would use the MB class as it allow for cancellation tokens.
hpooni 6 Posted February 17, 2015 Author Posted February 17, 2015 Agreed anything is possible with code, but just trying to understand the inner workings of the MB so I can utilize it efficiently. My channel retrieves live sporting event details and the respective stream for each one. Since the details can change all the time (ie. stream server changed, display different info once the event is live) I would like to display fresh content when ever the user enters the channel by clicking on it. Yes, I'm using HttpRequest to fetch the content every time the user enters the channel and it works fine. I just need to display the newly fetched content each time the user enters the channel. Unfortunately, previously cached content is always displayed.
Cheesegeezer 3104 Posted February 17, 2015 Posted February 17, 2015 Agreed anything is possible with code, but just trying to understand the inner workings of the MB so I can utilize it efficiently. My channel retrieves live sporting event details and the respective stream for each one. Since the details can change all the time (ie. stream server changed, display different info once the event is live) I would like to display fresh content when ever the user enters the channel by clicking on it. Yes, I'm using HttpRequest to fetch the content every time the user enters the channel and it works fine. I just need to display the newly fetched content each time the user enters the channel. Unfortunately, previously cached content is always displayed. I'm just trying to get my head around how your plugin works. Which Client are you testing in. I think you will probably have to have an eventhandler for when the user enters the channel. Sorry I'm not that familiar with Channels. So when does your Channel actually update at the moment and what triggers it Server Plugins are usually background apps that rarely require constant updating, i.e the scheduled task triggers events for your plugin to do stuff. Would monitoring an RSSfeed help your channel update in the background. I'm just bouncing ideas about
hpooni 6 Posted February 17, 2015 Author Posted February 17, 2015 The channel works the same way as other server channels such as Trailers. The content is fetched when the user enters the channel, which as I stated is not the issue. I just need to display this freshly fetched content instead of displaying the cached one. I'm assuming the server displays the old content as the id for the item fetched is same as before only some content has changed. I need to find a way to invalidate the id on each fetch or delete the existing content for the id somehow. No worries. Thanks for your help. I'll figure it out slowly, I'm sure.
Luke 42077 Posted February 17, 2015 Posted February 17, 2015 at the moment this is not possible, but if you get a channel released with everything but that, then i will gladly add it for you. The live tv in interfaces have a similar image url property but then also have an optional callback method to get images via other means. so we could always do something similar.
hpooni 6 Posted February 17, 2015 Author Posted February 17, 2015 Thanks Luke. I'll get the channel in release shape soon.
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