Can a plugin call OV with a Video URL? (1 Viewer)

mbuzina

Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    One question for you guys: Is there a way for OV to provide an "API" so that a different plugin can call OV with a complete video URL and OV will play it? Right now you can call to sites, categories and films, but for AirPlay to work, we would need to send a URL which is not in the current list of sites (it might be, but not always).

    Possible?
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    No, that is not possible currently.
    Not knowing or having looked at the source of the AirPlay plugin, I'd say they could basically include the OnlineVideos player code?
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Could be an option. I would of course prefer calling OnlineVids as it reduces code clutter & will keep the player up to date. Would such a functionality be hard to implement? And would you be willing to add s.th. like that? I guess other plugins could be interested in reusing such a player facility.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    If you don't want to copy code, then you require OnlineVideos to be installed anyway. In that case you can reference OnlineVideos.MediaPortal1.dll in your plugin (but not deploy it with your installer) and add this code in your plugin where you want to play an Url:

    Code:
    OnlineVideos.MediaPortal1.Player.PlayerFactory factory = new OnlineVideos.MediaPortal1.Player.PlayerFactory(PlayerType.Internal, "http://domain.com/vi.mp4");
    ((OnlineVideosPlayer)factory.PreparedPlayer).PrepareGraph();
    (((OnlineVideosPlayer)factory.PreparedPlayer).BufferFile());
    IPlayerFactory savedFactory = g_Player.Factory;
    g_Player.Factory = factory;
    g_Player.Play("http://domain.com/vi.mp4", g_Player.MediaType.Video);
    g_Player.Factory = savedFactory;

    It's an extract of how I start playback in OnlineVideos.
     

    Users who are viewing this thread

    Top Bottom