Bug Tracker
SourceForge
Feedback
Wiki
Stor
It is currently June 24th, 2017, 8:58 pm




 Page 1 of 15 [ 211 posts ]  Go to page 1, 2, 3, 4, 5 ... 15  Next
Author Message
 Post subject: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 12th, 2010, 9:46 pm 
User avatar
More than 1000 posts
More than 1000 posts
Developer

Joined: June 23rd, 2006, 1:04 am
Posts: 1661
Location: Groningen, the Netherlands
Netherlands
Introduction
The MeeMedia module for MeediOS uses plug-ins that consist mainly of an *.cs file (un-compiled C#) which can be created using any text editor. In this thread I will show how you can write your own plug-in for MeeMedia.

For this how-to I'll use the source "Motor Trend" as an example.


Step 1: create a plug-in defenition
First of all we have to make sure that the new plug-in will show up in MeeMedia by editting your local plugins.dat file with notepad or another text editor.
default path: C:\MeediOS\data\MeeMedia\plugins.dat

Between the last </plugin> and the closing </plugins> we'll create a new entry:
<plugin=Motor Trend>
    <installation_folder>Motor Trend</installation_folder>
    <caption>Motor Trend Video</caption>
    <revision>1</revision>
    <author>Blubberhoofd</author>
    <auto_update>False</auto_update>
    <description>Watch videos from Motor Trend</description>
    <category>Video</category>
    <sub_category>automotive</sub_category>
    <media_type>video</media_type>
    <mature_content>False</mature_content>
    <icon>Motor Trend.png</icon>
    <logo>Motor Trend_logo.png</logo>
    <background_picture>default</background_picture>
    <screen_file>MeeMedia_Plugin_Motor Trend</screen_file>
    <settings_file>default</settings_file>
    <scriptfile_name>Motor_Trend.cs</scriptfile_name>
    <host></host>
</plugin>
Note:
  • "auto update" should be set to "False" during development
  • "scriptfile_name" should not be using spaces, use "_" instead
  • "category" and "sub-category" are case sensitive

when you save and (re)start MeeMedia, you'll now see a new entry. 8)


Step 2: create the files
We'll have to create the folder that will contain the plug-in files in the MeeMedia data directory.
using the default path: C:\MeediOS\data\MeeMedia\Motor Trend

Now we'll add the artwork to the folder. The artwork consists of an icon and a logo. Some artwork has already been created in advance and can be found here, where you can also find the templates for creating your own artwork.

The final file that needs to be added to the plug-in folder is the "Motor_Trend.cs" file that contains the actual code for your plug-in. Attached to this post is a zip file containing the bare .cs file to start with.

Finally we'll have to add a screen file to the MeeMedia directory (default path: C:\MeediOS\plugins\module\MeeMedia) to keep things simple we'll copy an existing screen file, that also uses the video mediatype, and name that copy "MeeMedia_Plugin_Motor Trend.WPFUI.xaml".

when you (re)start MeeMedia, you'll now see that your new entry has artwork and that you're now actually able to open your plug-in. 8)


Step 3: Write the code
The code for a plug-in consists of three methods: Listings, GetItems and Play

3.1 Listings

the listings methods fills the plug-ins Listings_menu. In the code we have so far, when opening the plug-in in MeeMedia you'll see two dummy items (ListingName 1, ListingName 2)
the format is "caption1|url1;caption2|url2"

looking at the video section of the Motor trend site, you'll notice there are a few categories of videos defined that we can use.
- Road Tests -> http://www.motortrend.com/multimedia/vi ... index.html
- Auto Shows -> http://www.motortrend.com/multimedia/vi ... index.html
- Future Vehicles -> http://www.motortrend.com/multimedia/vi ... index.html
- Featured -> http://www.motortrend.com/multimedia/vi ... index.html
- Car Reviews -> http://www.motortrend.com/multimedia/vi ... index.html

when we then format this data we'll get the finished Listings method we want.
public string Listings(string settings)
        {
            return "Road Tests|http://www.motortrend.com/multimedia/videos/roadtests/index.html;Auto Shows|http://www.motortrend.com/multimedia/videos/auto_shows/index.html;Future Vehicles|http://www.motortrend.com/multimedia/videos/future/index.html;Featured|http://www.motortrend.com/multimedia/videos/features/index.html;Car Reviews|http://www.motortrend.com/multimedia/videos/reviews/index.html";
        }


3.2 GetItems

The GetItems is used to fill the page_menu with the individual media items.

When we open a menu item in the listings_menu that we've created in 3.1, the caption and the url of the selected item will be passed on to the GetItems method.
This line in the GetItems method will import the html code of the url we select and put it in a container called "content"
string content = SF.GetHttp(ListingData);
to actually see the same html code we'll be importing we can go to the same url in your browser and select to view the source from the view menu.

next we'll have to define the media items on the page by their start signature and end signature.
analizing http://www.motortrend.com/multimedia/vi ... index.html will show you that "<td valign='top'" uniquely mathes the start of a media item on the page and "</tr>" can be used to define the end.
we can now modify this line
foreach (string Unit in SF.GetRegExMatchCollection(content, @"<li[\W\w]+?</li>"))
to
foreach (string Unit in SF.GetRegExMatchCollection(content, @"<td valign='top'[\W\w]+?</tr>"))
we'll now have a container called "Unit" holding the code for a media item. From this item we'll need to get the signatures that define the data of the item.

- caption -> title=' * '
- image -> class='no_brdr w100 pad5_r' src=' * '
- medialink -> href=" * "
- description -> <div class='clr1 link pad5_t'> * <

these finding can be implemented like this
public string GetItems(string Listing, int page, IMeedioSystem meedioSystem, IMeedioMenu plugin_page_menu, string SearchString, string settings)
        {
            string ListingCaption = Listing.Split('|')[0];
            string ListingData = Listing.Split('|')[1];

            try
            {
      string content = SF.GetHttp(ListingData);
      plugin_page_menu.Clear();
      foreach (string Unit in SF.GetRegExMatchCollection(content, @"<td valign='top'[\W\w]+?</tr>"))
      {
                    //SF.Print(Unit);
          IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = SF.FixText(SF.GetRegExMatch(Unit, @"title='(?<name>[^']+)", "name"));
                    item["image"] = SF.GetRegExMatch(Unit, @"class='no_brdr w100 pad5_r' src='(?<name>[^']+)", "name");
                    item["medialink"] = "http://www.motortrend.com" + SF.GetRegExMatch(Unit, @"href=""(?<name>[^""]+)", "name");
                    item["mediatype"] = "video";
                    item["description"] = SF.FixText(SF.GetRegExMatch(Unit, @"<div class='clr1 link pad5_t'>(?<name>[^<]+)", "name"));
                    plugin_page_menu.Add(item);
      }
                return "success";
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }

note: by removing the "//" one can check if you've defined the start and end signatures for the media items correctly.
note: mediatype can be audio, video, videostream, images.

3.3 Play
we now have a plugin that imports the urls of the individual media items.

to see if the urls are actually correct we can modify the line
return item["medialink"].ToString();
to
return "browser::" + item["medialink"].ToString();


next we can get the link to the actual media file or the configuration to use with the sites mediaplayer in a browser window.

rest coming soon:

Step 4: publish your plug-in


Advanced options
- pagination
- sub-menus
- custom settings


Attachments:
Motor_Trend.zip [846 Bytes]
Downloaded 235 times


Last edited by DJ Heemstra on October 18th, 2010, 11:49 pm, edited 1 time in total.
_________________
DJ Heemstra a.k.a. blubberhoofd
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 17th, 2010, 1:07 pm 
User avatar
More than 1000 posts
More than 1000 posts

Joined: December 8th, 2006, 11:14 pm
Posts: 1393
Location: Sweden, Stockholm
WOW almost missed this 8) ... I'm of reading ... thx expect ??? :D


Edit:
hmm kind of did all that when adding the mature stuff, cos it could not do it from your server. :)
but I'll work on a logo ... :lol:

Edit2: Logo done
Edit3: All done! logo, background waiting for the "Part3"

*** Richard ***


Attachments:
meeMedia SVT-Play.png
meeMedia SVT-Play.png [ 145.74 KiB | Viewed 8248 times ]
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 19th, 2010, 9:49 pm 
User avatar
More than 1000 posts
More than 1000 posts

Joined: December 8th, 2006, 11:14 pm
Posts: 1393
Location: Sweden, Stockholm
Oki Time for 1st question

I get the image but would like to do a replace to another one.

[url]item["image"] = SF.GetRegExMatch(Unit, @"src=""(?<name>[^""]+)", "name");[/url]

Gives me image like:

http://media.svt.se/download/mcc/flash/20101018/WW-2010-1018-FANTOMBILD/WW-2010-1018-FANTOMBILD_thumb_0.jpg

But I would like

http://media.svt.se/download/mcc/flash/20101018/WW-2010-1018-FANTOMBILD/WW-2010-1018-FANTOMBILD_start_0.jpg

So I need to Replace "thumb" with "start"

many thx

*** Richard ***


Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 19th, 2010, 10:18 pm 
User avatar
More than 1000 posts
More than 1000 posts

Joined: December 8th, 2006, 11:14 pm
Posts: 1393
Location: Sweden, Stockholm
Also My Wanted "Caption" is to be found between <span > to </span> like

<li class=" a2199893">

<a href="/v/2199893/tennis/federer_anlande_till_stockholm_utan_jetlag" title="" class="overlay tooltip">

<img class="thumbnail" src="http://media.svt.se/download/mcc/flash/20101019/10-federersynk/10-federersynk_thumb_0.jpg" width="128" height="72" alt="" />

<span >
Tennis - Federer anlände till Stockholm...</span>
<em>
Ikväll 19.08&nbsp;<span class="nowrap">L&auml;ngd: 07:28</span>
</em>
</a>
</li>


item["caption"] = SF.FixText(SF.GetRegExMatch(Unit, @"<span""(?<name>[^""]+)", "name"));


that does not work 8)

Many Thx
***Richard***


Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 19th, 2010, 10:19 pm 
User avatar
More than 1000 posts
More than 1000 posts
Developer

Joined: June 23rd, 2006, 1:04 am
Posts: 1661
Location: Groningen, the Netherlands
Netherlands
item["image"] = SF.GetRegExMatch(Unit, @"src=""(?<name>[^""]+)", "name").Replace("_thumb_", "_start_");


item["caption"] = SF.FixText(SF.GetRegExMatch(Unit, @"<span >(?<name>[^<]+)", "name"));


EDIT: forgot a space character between "<span" and ">" :oops:


Last edited by DJ Heemstra on October 19th, 2010, 11:37 pm, edited 1 time in total.


_________________
DJ Heemstra a.k.a. blubberhoofd
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 19th, 2010, 10:42 pm 
User avatar
More than 1000 posts
More than 1000 posts
Developer

Joined: June 23rd, 2006, 1:04 am
Posts: 1661
Location: Groningen, the Netherlands
Netherlands
@ztoner

using System;
using System.IO;
using MeediOS;
using SharedFunctions;
using MeeMedia.Interfaces;

namespace MeeMedia.Plugin.SVT_play
{
    public class SVT_play : IMeeMediaPlugin
    {
        SharedFunctions.Functions SF = new SharedFunctions.Functions();

        public string Listings(string settings)
        {
            return "Senaste program|http://svtplay.se/?ajax,pb/pb,a1364143,;Senaste nyhetsprogram|http://svtplay.se/?ajax,pb/pb,a1527537,;Rekommenderat|http://svtplay.se/?ajax,pb/pb,a1364142,;Mest sedda program|http://svtplay.se/?ajax,pb/pb,a1364144,;Sök|search";
        }

        public string GetItems(string Listing, int page, IMeedioSystem meedioSystem, IMeedioMenu plugin_page_menu, string SearchString, string settings)
        {
            string ListingCaption = Listing.Split('|')[0];
            string ListingData = Listing.Split('|')[1];

            try
            {
                string content = SF.GetHttp(ListingData + page.ToString());
                plugin_page_menu.Clear();
                if (page > 1)
                {
                    IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = "previous (page " + (page - 1).ToString() + ")";
                    item["image"] = "previous-img";
                    item["medialink"] = "previous::" + (page - 1);
                    item["reference"] = ListingData;
                    item["mediatype"] = "video";
                    item["description"] = "Go to the previous page.";
                    plugin_page_menu.Add(item);
                }
                foreach (string Unit in SF.GetRegExMatchCollection(content, @"<li class=[\W\w]+?</li>"))
                {
                    //SF.Print(Unit);
                    IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = SF.FixText(SF.GetRegExMatch(Unit, @"<span >(?<name>[^<]+)", "name"));
                    item["image"] = SF.GetRegExMatch(Unit, @"src=""(?<name>[^""]+)", "name");
                    item["medialink"] = "http://svtplay.se" + SF.GetRegExMatch(Unit, @"href=""(?<name>[^""]+)", "name");
                    item["mediatype"] = "video";
                    item["description"] = SF.FixText(SF.GetRegExMatch(Unit, @"title=""(?<name>[^""]+)", "name"));
                    plugin_page_menu.Add(item);
                }
                if (page > 0)
                {
                    IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = "next (page " + (page + 1).ToString() + ")";
                    item["image"] = "next-img";
                    item["medialink"] = "next::" + (page + 1);
                    item["reference"] = ListingData;
                    item["mediatype"] = "video";
                    item["description"] = "Go to the next page.";
                    plugin_page_menu.Add(item);
                }
                return "success";
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }

        public string Play(IMeedioItem item, string settings)
        {
            try
            {
                string content = SF.GetHttp(item["medialink"].ToString());
                content = SF.GetRegExMatch(content, @"param name=""flashvars"" value=""(?<name>[^""]+)", "name");
                string filecontent = @"<html><body leftmargin=""0"" topmargin=""0"" rightmargin=""0"" bottommargin=""0""><object type=""application/x-shockwave-flash"" data=""http://svtplay.se/flash/svtplayer-2010.15.swf"" width=""100%"" height=""100%""><param name=""wmode"" value=""normal"" /><param name=""menu"" value=""true"" /><param name=""allowfullscreen"" value=""true"" /><param name=""allowscriptaccess"" value=""always"" /><param name=""flashvars"" value=""" + content + @""" /></object></body></html>";
                string tempfile = SF.GetRegExMatch(settings, @"<data_folder>(?<name>[^<]+)", "name") + "temp.html";
                File.WriteAllText(tempfile, filecontent);
                SF.Print(tempfile);
                return "browser::" + tempfile;
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }

    }
}


because of the rtmp streams I'm creating a customized html page with the falsh player in it on the fly, sadly the customwebbrowser doesn't seem to support loading local files?

EDIT: did some experiments, the page I'm creating runs fine in Firefox but not in IE, guess I'll have to do some tweaking ;)


Attachments:
SVT play_logo.png
SVT play_logo.png [ 33.68 KiB | Viewed 8214 times ]

_________________
DJ Heemstra a.k.a. blubberhoofd
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 19th, 2010, 11:06 pm 
User avatar
More than 1000 posts
More than 1000 posts

Joined: December 8th, 2006, 11:14 pm
Posts: 1393
Location: Sweden, Stockholm
blubberhoofd wrote:
item["image"] = SF.GetRegExMatch(Unit, @"src=""(?<name>[^""]+)", "name").Replace("_thumb_", "_start_");


item["caption"] = SF.FixText(SF.GetRegExMatch(Unit, @"<span>(?<name>[^<]+)", "name"));


Dam your fast :D I was alomost there with the replace thing the secund does not work thow :/
your so fast I didnt even see the comlete file :P testing now.
*** Richard ***


Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 19th, 2010, 11:27 pm 
User avatar
More than 1000 posts
More than 1000 posts
Developer

Joined: June 23rd, 2006, 1:04 am
Posts: 1661
Location: Groningen, the Netherlands
Netherlands
this does work with IE and the customwebbrowser
public string Play(IMeedioItem item, string settings)
        {
            try
            {
                string content = SF.GetHttp(item["medialink"].ToString());
                content = SF.GetRegExMatch(content, @"param name=""flashvars"" value=""(?<name>[^""]+)", "name");
                string filecontent = @"<html><body leftmargin=""0"" topmargin=""0"" rightmargin=""0"" bottommargin=""0""><object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" width=""100%"" height=""100%"" id=""playerSwf""><param name=""movie"" value=""http://svtplay.se/flash/svtplayer-2010.15.swf"" /><param name=""menu"" value=""true"" /><param name=""wmode"" value=""window"" /><param name=""allowfullscreen"" value=""true"" /><param name=""allowscriptaccess"" value=""always"" /><param name=""flashvars"" value=""" + content + @""" /></object></body></html>";
                string tempfile = SF.GetRegExMatch(settings, @"<data_folder>(?<name>[^<]+)", "name") + "temp.html";
                File.WriteAllText(tempfile, filecontent);
                SF.Print(tempfile);
                return "browser::" + tempfile;
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }


I'll do some research to see if the player interface at the bottom can be made to "auto hide"



_________________
DJ Heemstra a.k.a. blubberhoofd
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 19th, 2010, 11:35 pm 
User avatar
More than 1000 posts
More than 1000 posts

Joined: December 8th, 2006, 11:14 pm
Posts: 1393
Location: Sweden, Stockholm
All Files that are not rtmp we can use the image url to get the .flv video insted.
If the image is

http://media.svt.se/download/mcc/flash/20101016/IN-2010-1016-Divine/IN-2010-1016-Divine_thumb_0.jpg

then the video will be at

http://www0.c00928.cdn.qbrick.com/00928/kluster/20101016/IN-2010-1016-Divine.flv

Replace

http://media.svt.se/download/mcc/flash/

with

http://www0.c00928.cdn.qbrick.com/00928/kluster/

Replace

_thumb_0.jpg (or _start_0) depends on what image to use with .flv

should work :D

Edit: my mistake it does not :/

*** Richard ***


Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 19th, 2010, 11:51 pm 
User avatar
More than 1000 posts
More than 1000 posts
Developer

Joined: June 23rd, 2006, 1:04 am
Posts: 1661
Location: Groningen, the Netherlands
Netherlands
this is a more reliable method to get non-rtmp streams
        public string Play(IMeedioItem item, string settings)
        {
            try
            {
                string content = SF.GetHttp(item["medialink"].ToString());
                content = SF.GetRegExMatch(content, @"param name=""flashvars"" value=""(?<name>[^""]+)", "name");
                if (!content.Contains("pathflv="))
                {
                    string content = SF.GetHttp(item["medialink"].ToString());
                    content = SF.GetRegExMatch(content, @"param name=""flashvars"" value=""(?<name>[^""]+)", "name");
                    string filecontent = @"<html><body leftmargin=""0"" topmargin=""0"" rightmargin=""0"" bottommargin=""0""><object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" width=""100%"" height=""100%"" id=""playerSwf""><param name=""movie"" value=""http://svtplay.se/flash/svtplayer-2010.15.swf"" /><param name=""menu"" value=""true"" /><param name=""wmode"" value=""window"" /><param name=""allowfullscreen"" value=""true"" /><param name=""allowscriptaccess"" value=""always"" /><param name=""flashvars"" value=""" + content + @""" /></object></body></html>";
                    string tempfile = SF.GetRegExMatch(settings, @"<data_folder>(?<name>[^<]+)", "name") + "temp.html";
                    File.WriteAllText(tempfile, filecontent);
                    return "browser::" + tempfile;
                }
                else
                {
                    return SF.GetRegExMatch(content, @"pathflv=(?<name>[^&]+)", "name");
                }
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }



_________________
DJ Heemstra a.k.a. blubberhoofd
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 20th, 2010, 12:23 am 
User avatar
More than 1000 posts
More than 1000 posts

Joined: December 8th, 2006, 11:14 pm
Posts: 1393
Location: Sweden, Stockholm
Well I got this far tonight (before you did it all) :D
using System;
using MeediOS;
using SharedFunctions;
using MeeMedia.Interfaces;

namespace MeeMedia.Plugin.Svt_play
{
    public class Svt_Play : IMeeMediaPlugin
    {
        SharedFunctions.Functions SF = new SharedFunctions.Functions();

   public string Listings(string settings)
        {
            return "Senaste Klippen|http://svtplay.se/?ajax,cb/cb,a1364145,1,f,-1";
        }

        public string GetItems(string Listing, int page, IMeedioSystem meedioSystem, IMeedioMenu plugin_page_menu, string SearchString, string settings)
        {
            string ListingCaption = Listing.Split('|')[0];
            string ListingData = Listing.Split('|')[1];

            try
            {
                string content = SF.GetHttp(ListingData + page.ToString());
                plugin_page_menu.Clear();
                if (page > 1)
                {
                    IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = "previous (page " + (page - 1).ToString() + ")";
                    item["image"] = "previous-img";
                    item["medialink"] = "previous::" + (page - 1);
                    item["reference"] = ListingData;
                    item["mediatype"] = "video";
                    item["description"] = "Go to the previous page.";
                    plugin_page_menu.Add(item);
                }
                foreach (string Unit in SF.GetRegExMatchCollection(content, @"<li class=[\W\w]+?</li>"))
                {
                    //SF.Print(Unit);
          IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = SF.FixText(SF.GetRegExMatch(Unit, @"<span >(?<name>[^<]+)", "name"));
                    item["image"] = SF.GetRegExMatch(Unit, @"src=""(?<name>[^""]+)", "name").Replace("_thumb_", "_start_");
                    item["medialink"] = "http://svtplay.se" + SF.GetRegExMatch(Unit, @"<a href=""(?<name>[^""]+)", "name") + "/episodePage?type=recent&limit=10&hideShow=0&hideArrows=1&page=";
                    item["mediatype"] = "video";
                    item["description"] = SF.FixText(SF.GetRegExMatch(Unit, @"Title=""(?<name>[^""]+)", "name"));
                    plugin_page_menu.Add(item);
                }
                if (page > 0)
                {
                    IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = "next (page " + (page + 1).ToString() + ")";
                    item["image"] = "next-img";
                    item["medialink"] = "next::" + (page + 1);
                    item["reference"] = ListingData;
                    item["mediatype"] = "video";
                    item["description"] = "Go to the next page.";
                    plugin_page_menu.Add(item);
                }
                return "success";
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }

        public string Play(IMeedioItem item, string settings)
        {
            try
            {
                return item["medialink"].ToString();
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }
    }
}


It was no god Idea to switch the thumbs to the hi res
.Replace("_thumb_", "_start_")
as it slowed down the browsing. but can that be done on fly when switching to the detail screen?
also I didn't manage to get the page switch (its the same)
I know I need to switch http://svtplay.se/?ajax,cb/cb,a1364145,1,f,-1 To http://svtplay.se/?ajax,cb/cb,a1364145,2,f,-1
Also I'm trying to fin a way to get the description from the rss as it got a better one
itemnr link?
I know I got the flv file in meedio by using replace and some seesharp but dot remember how :/

Funny we did almost the same logo :D (btw have you noticed the grey overlay of yours got a black pixel in the middle of it)
Thanks 4 the help
*** Richard ***


Attachments:
Svt-Play_background.png
Svt-Play_background.png [ 131.35 KiB | Viewed 8204 times ]
Svt-Play_logo.png
Svt-Play_logo.png [ 15.72 KiB | Viewed 8204 times ]
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 20th, 2010, 3:17 am 
User avatar
More than 1000 posts
More than 1000 posts
Developer

Joined: June 23rd, 2006, 1:04 am
Posts: 1661
Location: Groningen, the Netherlands
Netherlands
http://svtplay.se/?ajax,cb/cb,a1364145,1,f,-1 To http://svtplay.se/?ajax,cb/cb,a1364145,2,f,-1

can be done like this
public string Listings(string settings)
        {
            return "Senaste Klippen|http://svtplay.se/?ajax,cb/cb,a1364145,";
        }
and in GetItems
string content = SF.GetHttp(ListingData + page.ToString() + ",f,-1");



_________________
DJ Heemstra a.k.a. blubberhoofd
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 20th, 2010, 11:57 am 
User avatar
More than 1000 posts
More than 1000 posts

Joined: December 8th, 2006, 11:14 pm
Posts: 1393
Location: Sweden, Stockholm
Tried like This, but does not work. Now I don't get any items, my previous got 1st page at least :D
So What Did I Miss?
using System;
using MeediOS;
using SharedFunctions;
using MeeMedia.Interfaces;

namespace MeeMedia.Plugin.Svt_play
{
    public class Svt_Play : IMeeMediaPlugin
    {
        SharedFunctions.Functions SF = new SharedFunctions.Functions();

   public string Listings(string settings)
        {
            return "Senaste Klippen|http://svtplay.se/?ajax,cb/cb,a1364145";
        }

        public string GetItems(string Listing, int page, IMeedioSystem meedioSystem, IMeedioMenu plugin_page_menu, string SearchString, string settings)
        {
            string ListingCaption = Listing.Split('|')[0];
            string ListingData = Listing.Split('|')[1];

            try
            {
                string content = SF.GetHttp(ListingData + page.ToString() + "1,f,-1");
                plugin_page_menu.Clear();
                if (page > 1)
                {
                    IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = "previous (page " + (page - 1).ToString() + ")";
                    item["image"] = "previous-img";
                    item["medialink"] = "previous::" + (page - 1);
                    item["reference"] = ListingData;
                    item["mediatype"] = "video";
                    item["description"] = "Go to the previous page.";
                    plugin_page_menu.Add(item);
                }
                foreach (string Unit in SF.GetRegExMatchCollection(content, @"<li class=[\W\w]+?</li>"))
                {
                    //SF.Print(Unit);
          IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = SF.FixText(SF.GetRegExMatch(Unit, @"<span >(?<name>[^<]+)", "name"));
                    item["image"] = SF.GetRegExMatch(Unit, @"src=""(?<name>[^""]+)", "name").Replace("_thumb_", "_start_");
                    item["medialink"] = "http://svtplay.se" + SF.GetRegExMatch(Unit, @"href=""(?<name>[^""]+)", "name");
                    item["mediatype"] = "video";
                    item["description"] = SF.FixText(SF.GetRegExMatch(Unit, @"Title=""(?<name>[^""]+)", "name"));
                    plugin_page_menu.Add(item);
                }
                if (page > 0)
                {
                    IMeedioItem item = meedioSystem.NewItem();
                    item["caption"] = "next (page " + (page + 1).ToString() + ")";
                    item["image"] = "next-img";
                    item["medialink"] = "next::" + (page + 1);
                    item["reference"] = ListingData;
                    item["mediatype"] = "video";
                    item["description"] = "Go to the next page.";
                    plugin_page_menu.Add(item);
                }
                return "success";
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }

        public string Play(IMeedioItem item, string settings)
        {
            try
            {
                return item["medialink"].ToString();
            }
            catch (Exception e)
            {
                return "error: " + e.ToString();
            }
        }
    }
}

Edit: Found it missing , at end of url 8)
Edit2: How can I see what the code returns from url ?
Edit3: any idea how to list the categories? http://svtplay.se/kategorier
Must be something like in the MoviesAnd script? or?
Is it smarter to get [image] and [Image2] and use 1st when browsing and second on the detailscreen?
browsing get a bit slow with the big Images(start), but then the "thumb" looks horrible in the detail where the "start" image looks really good.
***Richard***


Last edited by ztoner on October 21st, 2010, 3:42 pm, edited 1 time in total.

Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 20th, 2010, 2:49 pm 
User avatar
More than 1000 posts
More than 1000 posts
Developer

Joined: June 23rd, 2006, 1:04 am
Posts: 1661
Location: Groningen, the Netherlands
Netherlands
you can add a line like this
SF.Print(*);
any time you need to see some output.

in your case you would replace
string content = SF.GetHttp(ListingData + page.ToString() + "1,f,-1");
with
SF.Print(ListingData + page.ToString() + "1,f,-1");
string content = SF.GetHttp(ListingData + page.ToString() + "1,f,-1");
SF.Print(content);


I'll see what i can do about a high res thumbnail.



_________________
DJ Heemstra a.k.a. blubberhoofd
Offline
 Profile  
 
 Post subject: Re: [Official Thread] MeeMedia plug-in how-to
PostMessage posted...: October 21st, 2010, 3:41 pm 
User avatar
More than 1000 posts
More than 1000 posts

Joined: December 8th, 2006, 11:14 pm
Posts: 1393
Location: Sweden, Stockholm
blubberhoofd wrote:
you can add a line like this
SF.Print(*);
any time you need to see some output.

in your case you would replace
string content = SF.GetHttp(ListingData + page.ToString() + "1,f,-1");
with
SF.Print(ListingData + page.ToString() + "1,f,-1");
string content = SF.GetHttp(ListingData + page.ToString() + "1,f,-1");
SF.Print(content);


I'll see what i can do about a high res thumbnail.


Oki thx, but the problem is that I don't even know how to "run" the script in visual express, to tell the truth, I aint got a clue of what I'm doing but its quite fun :lol:
I know zero of programing 8)
Edit: Have you looked at StreamTransport? http://www.streamtransport.com/
*** Richard ***


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 15 [ 211 posts ]  Go to page 1, 2, 3, 4, 5 ... 15  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

cron