New plugin questions

As there didn’t seem to be many canadian content plugins, I’ve written one for TheComedyNetwork.ca. For the most part everything seems to be working but I have two unresolved issues that I hope someone can help me answer:


  1. Most of the videos work fine, but some don’t. The site plays advertisements before and in between video clips and, while this isn’t a problem for many shows (The Daily Show/ The Colbert Repot/etc… work fine), it doesn’t work for others (e.g. South Park/etc…). For the shows that don’t work I get the first advertisement, then the screen goes blank and I only get audio for the show itself. I’m not sure if it’s related, but I seem to recall that I had to install silverlight to watch southpark, but not the daily show…I looked at the different HTTP requests made by the player when I watch the different shows in firefox, but don’t see an obvious difference.


  2. The search feature for the site returns me “episode” numbers for each video returned. To translate these episode numbers into URLs for a show itslef, I have to query the server. At the moment I’m querying the server for each episode returned, but I’d prefer to only query for the URL if the user actually selects a video to be played (I have access to the description/thumb/title/etc… without the URL). Unfortunately, I can’t find a way to do this - I expected to be able to do something like dir.Append(Function(WebVideoItem(…)) just as I could with VideoItems/DirectoryItems/etc…, then resolve the URL in the called function… but this trows an exception.



    Any suggestions would be welcome. If it helps, I’m using version 1 of the framework.



    Thanks!


The usual reason for audio-only is because the browser navigated away from the current page or instantiated a new plug-in on the current page. This is a really hard case to handle right now. I can't access that site from the US, so it's hard for me to tell what's going on.

As a worst case scenario, you might want to consider disabling those shows for now.



Unfortunately there is no way to redirect to a WebVideoItem right now. Plex decides based on the initial URL whether to open an HTTP connection for video or web video, so there's no way to switch in the middle, at least for now. The same constraint holds for redirecting to mms:// or rtmp://, for the same reason.

It's on the list to allow this sort of redirection, but it's not likely to appear for a while :(

Sorry to be the bearer of bad news, and please PM me if you'd like access to our chat support room for plug-in developers.


Hrm. I'm in a bit of a bind since the way it's coded is pretty generic in that I haven't hard coded any "shows", I just scrape the website for the list and display it. I'll keep looking in my spare time...but I's very confusing - Using HTTPFox I see all of the outgoing HTML requests that firefox makes to watch the shows and they look identical.


No worries. It works as it is, it's just a bit noisy. As soon as the feature is available, I'll change the plugin.


Not at all! Actually, I was amazed at how easy it is to write a plugin considering I usually code in C and rarely use python. Just about 4 quick functions, a bit of image manipulation, and and XML site description. Most of the time spent was trying to look at the framework code and the forums to see how it was done - once you get those docs it will be a piece of cake for new devs. Awesome job on the framework!

For now I've posted the plugin on the "Unsupported plugins" wiki so that people can make use of what's there (most things work). I'm thinking that I'll do some other plugins for the other Canadian content sites unless another Canadian dev jumps on board, so I might PM you about that support room later if I have more questions.

Okay, so I had another quick look at this today and here’s what I now know. It seems that I was right about some of the videos from the site are played by silverlight and others are not - If I use a line like this in my site config :



<site site="http://watch.thecomedynetwork.ca"   plugin="http://watch.thecomedynetwork.ca/Flash/player.swf.*" initialState="playing" version="1.0">


Then things work as I described above (it's what I have been using). If I switch the line to this:


<site site="http://watch.thecomedynetwork.ca"   plugin="silverlight" initialState="playing" version="1.0">



then the videos that were audio only start to work, but the ones the worked originally switch to audio only. What's the best way to fix this? As far as I can tell, there's no way to tell the type of video from the URL but with a lot of extra work in the plugin I think I can tell in advance what type of clip it is but I'm not sure if this even helps me : it's especially annoying since the advertisements and other videos on the same playlist alternate between silverlight and non-silverlight after my plugin has passed the WebVideoItem to plex, so I'm guessing that unless plex has some way to auto-switch between the players (e.g. if .wmv then silverlight, otherwise the swf player) that there's nothing I can do? Is this possible?

Any advice would help, and apologies in advance if this should be obvious to me - I'm definitely not a web developer type.... just really like plex :) ! Thanks!

You should be able to have two site configuration files, one for Flash and one for Silverlight. The alternating between might be tricky, though, I’m not sure I’ve encountered that or gotten it to work. You can try the action which causes the state machine to rematch plug-ins based on what’s it’s seen, but I’m not sure that it would help with your situation :frowning:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.