Mediasite Plugin For MediaPortal (1 Viewer)

Vic Demented

Retired Team Member
  • Premium Supporter
  • March 4, 2013
    42
    25
    53
    Brugge, Belgium
    Home Country
    United States of America United States of America
    After speaking with Morpheus, he suggested that I post this here. I am currently working on building a plugin for MP2 that is capable of displaying university course content streamed from a Mediasite server, and while I am quite familiar with the Mediasite API, I am very green when it comes to XAML so I am reaching out to the MP community to see who is interested in teaming up to help build this plugin.

    Background Info:
    Mediasite streams lectures that constist of videos (H.264 MP4) and slides (jpg) (some lectures may have just one either or both) that are synced with the video. My goal is to build a full featured plugin that enables the user to search, browse, and play this content in a more visually pleasing way.

    Here's a link to a sample Catalog:
    http://mediasite.video.ufl.edu/Medi...e754021/?state=olHQL8W7F8Cu0TfhJmeO&_suid=997

    Here's a link to a sample of what type of content is produced by Mediasite :
    http://mediasite.video.ufl.edu/Medi...?catalog=58a2c26a-048c-42de-8950-c7f68c1e7540

    I was thinking a modified version of OnlineVideos might work. I could return a list of folders and when you select the folder then I can display a list of presentations that include a preview image, all the metadata, urls etc. Then they could click the presentation to play and the player would have two windows. One larger window for the slide content and a smaller window for the video. It would be cool if we could let the user swap them like the sample above. We would also need a settings screen so that we could store the username & password and URL for the mediasite API.

    The GitHub repository is located here: https://github.com/VicDemented/MediaPortal-2
    The plugin thus far has made some real good progress in a short amount of time. I was able to get a dev server setup with the kind folks at Sonic Foundry so that we could have a real environment to test against.

    07_reflexion_no_osd-jpg.124649


    Thanks to Morpheus and his hard work, the UI is coming along nicely. Currently, the user browses for the presentation they want to watch via a list and once the video begins to stream the video plays on the left and the slides will be displayed on the right. The slides are synced with the video and if the user clicks on one of the slides in the thumbnail filmstrip it will jump the player to the point in the video where that slide is shown.
     
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Nice idea!

    I think the GUI can be created without major problems, we have everything we will need:
    • Big image for current slide (regular image with URL source)
    • List of small slide-thumbnails, will be scrollable
    • Video player plays the video stream
      • If slide has a video timecode associated we could seek to this position, but:
      • Seeking webstreams might not be possible (depending in stream protocol and source filter)
    Most things we will deal with are ListItems, ListViews/WrapPanels and regular Images with URL sources and a VideoPlayer to play streams.

    Do you have already some source codes available?
     

    Vic Demented

    Retired Team Member
  • Premium Supporter
  • March 4, 2013
    42
    25
    53
    Brugge, Belgium
    Home Country
    United States of America United States of America
    I have some code, if you want to setup the SVN/Git, repository I can upload a starter solution that I am working on.
     

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    I have some code, if you want to setup the SVN/Git, repository I can upload a starter solution that I am working on.
    I would suggest you create an account at http://github.com , if not done already.
    After that you can fork the MP2 repository: https://github.com/MediaPortal/MediaPortal-2
    You will be able to even give others, i.e. morpheus access to this repository.

    I've doing it similar for things WIP or experimental branches etc https://github.com/chefkoch/MediaPortal-2/
     
    Last edited:

    Vic Demented

    Retired Team Member
  • Premium Supporter
  • March 4, 2013
    42
    25
    53
    Brugge, Belgium
    Home Country
    United States of America United States of America
    Included in the solution is a MediasitePlugin project. I've included the WCF proxy class and a reference to : MediasiteAPIConnector

    This assembly takes in the URL to a Mediasite WCF service (along with a public/private key) and returns a RequestTicket which must be included with every API request. Here's an example that's included in the new project:

    Code:
    //Returns a list of presentations (lectures) between 01/01/00 & the present
     
    public ItemsList loadPresentations()
    	{
    		var _pRequest = new QueryPresentationsByCriteriaRequest(){ Ticket = _RequestTicket, ApplicationName = "MediaPortal2", QueryCriteria = new PresentationQueryCriteria(){ StartDate = Convert.ToDateTime("01/01/00"), EndDate = System.DateTime.Now, PermissionMask = ResourcePermissionMask.Read}, Options= new QueryOptions(){ BatchSize = 100, StartIndex = 0}};
    		var _tpresentations = _Client.QueryPresentationsByCriteria(_pRequest);
    		var list = new ItemsList();
    		for (int i = 0; i < _tpresentations.Presentations.Length; i++)
    		{
    			ListItem _item = new ListItem("Name", _tpresentations.Presentations[i].Name);
    			_item.SetLabel("ID", _tpresentations.Presentations[i].Id);
    			_item.SetLabel("URL", _tpresentations.Presentations[i].VideoUrl + "?AuthTicket=" + CreateAuthTicket(_tpresentations.Presentations[i].Id));
    			list.Add(_item);
    		}
    		return list;
    	}
     
    //Creates an authenticated ticket to be appended to the VideoURL so that it can be streamed without a username/password
    public string CreateAuthTicket(string MediasiteResourceID)
    	{
    		var _aRequest = new CreateAuthTicketRequest(){ ApplicationName = _Application, Ticket = _RequestTicket, TicketSettings = new CreateAuthTicketSettings(){ Username = "MediaPortalUser", ResourceId = MediasiteResourceID, MinutesToLive = 10}};
    		return _Client.CreateAuthTicket(_aRequest).AuthTicketId;
    	}
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Next step should be following:
    Then I can step into skin creation. And I think I will make some comments on coding style and conventions ;)
     

    Vic Demented

    Retired Team Member
  • Premium Supporter
  • March 4, 2013
    42
    25
    53
    Brugge, Belgium
    Home Country
    United States of America United States of America
    Sorry for the delay but I've been out of town for the past week. Anyway, I think I did it right. I checked out the dev branch and then created FEAT_Mediasite and added the project. Comitted and pushed.
     

    Vic Demented

    Retired Team Member
  • Premium Supporter
  • March 4, 2013
    42
    25
    53
    Brugge, Belgium
    Home Country
    United States of America United States of America
    Whoops...forgot to add it to the client solution..I'll do that now.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Just checked out your branch. First things todo:
    1. Set your plugin as target "x86", remove "Mixed Platform" and "AnyCPU" from project solution. All MP2 projects are targeted at x86.
    2. When I tried to run MP2-Client with your plugin included, it fails due to duplicated resource registration (result of copy HelloWorldSkin)
      System.ArgumentException: At location '/Resources/Skin', a plugin item with id 'HelloWorldSkin' is already registered
      bei MediaPortal.Common.PluginManager.PluginRuntime.RegisterItem(PluginItemMetadata itemMetadata) in D:\Coding\MP\MP2\MP2_git\MediaPortal-2-VicDemented\MediaPortal\Source\Core\MediaPortal.Common\PluginManager\PluginRuntime.cs:Zeile 595.
      bei MediaPortal.Common.PluginManager.PluginRuntime.RegisterItems() in D:\Coding\MP\MP2\MP2_git\MediaPortal-2-VicDemented\MediaPortal\Source\Core\MediaPortal.Common\PluginManager\PluginRuntime.cs:Zeile 331.
      bei MediaPortal.Common.Services.PluginManager.PluginManager.TryEnable(PluginRuntime plugin, ICollection`1 autoActivatePlugins) in D:\Coding\MP\MP2\MP2_git\MediaPortal-2-VicDemented\MediaPortal\Source\Core\MediaPortal.Common\Services\PluginManager\PluginManager.cs:Zeile 839.
      This needs to be changed inside plugin.xml
    I could change it myself, but better you do it
     
    Last edited:

    Users who are viewing this thread

    Top Bottom