MP2 Plugin - Getting Started (Directory Tree and Player) (1 Viewer)

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Ok, this is in principle the same as our "Media" plugin does, but the backend is different. I'd recommend you to take a look into this plugin first. But on the other hand it's also one of the most complex ones, because of it's generic approach and extensibility.

    As a simpler start for your own plugin I'd point to the "Skin Test" plugin (enabled in DEBUG builds only). It shows how to create the basic plugin structure (skin, workflow, language files, code).

    Then the "MediaItem" will be important, it refers to any video, image, audio item that can be played back. Also non-playable items exists, like "Series", "Episodes", "Movie Collections" and so on.

    The MediaItem then contain so called MetadataAspects, for example the Series/Season information of a series (see "EsisodeAspect").

    Finally all players in the system get a MediaItem passed to initialize and start playback.
     

    da3dsoul

    Retired Team Member
  • Team MediaPortal
  • August 29, 2020
    86
    45
    Home Country
    United States of America United States of America
    Where are these plugins?
    I got MediaPortal2 to build. Here's a note for everyone: it doesn't build with .Net 5.0 tools. That took longer to realize than I would have hoped. If we upgrade the projects to the new format, it should theoretically work. UPnP didn't work with 5.0, so I can try converting that one to verify. It's not a priority, but eventually, it'll be a pain to get pre-5.0 tools, and the newer project format is much more pleasant in general.

    EDIT: I got UPnP to compile using net5 build tools, though I did disable a bunch of AssemblyInfo stuff, as I didn't understand what in the build chain was breaking it. So theoretically, the whole solution could be converted to the new 2017 csproj format. I attached a patch for anyone interested. I'm not going to PR it or anything, as it's not finished.

    EDIT2: If you want a legitimate reason to convert to the new format, other than because people should stop using EOL products, the build times are significantly faster.
     

    Attachments

    • Convert_UPnP_csproj_to_2017_csproj_format.patch
      10.4 KB
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Thanks for reporting back :) I think until now no one has tried .Net 5.0 tools yet. I can explain the current process and build architecture:

    Once you have cloned the MP2 git repo, you have folders:
    • MediaPortal
      • Source --> Here are the main solutions to open (MP2-Client.sln, MP2-Server.sln)
      • Build --> Here you can use the "MSBUILD_Create_Release_Full_Installer.bat", which compiles all required projects, updates language resources from transifex and then assembles a .msi installer

        All build scripts call for initialization "MSBUILD_Rebuild_Base.bat". There is tried to find the best possible MSBUILD version. FEAT_WIP2.3 branch prefers VS2019 community version:
        Code:
        set MB="%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
        . If you like to use other MSBUILD path, add it to top of the list.

        This set of batch files also create the Assembly VersionInfo based on Date, Git branch/tag/hash and commit count

        If transifex is not setup correctly, you could try "MSBUILD_Create_Release_Full_Installer_NoTransifex.bat", this skips language update and uses the cached ones (faster, no transifex account needed).

      • Bin --> Once build is done, you find there the compiled version, including all files and also the created setup
    Where are these plugins?
    The source you find here (both included in MP2-Client.sln):
    • Media: (git root)\MediaPortal-2\MediaPortal\Source\UI\UiComponents\Media
    • GUITestPlugin: MediaPortal-2\MediaPortal\Resources\GUITestPlugin\
    • HelloWorld
    Inside MP2-Client solution you will find the testers under Incubator/UiComponents
    1598946516897.png
     
    Last edited:

    da3dsoul

    Retired Team Member
  • Team MediaPortal
  • August 29, 2020
    86
    45
    Home Country
    United States of America United States of America
    Ok, thanks. I found out it was net5 problems because Rider threw a bunch of errors but the batch scripts worked. The msbuild in my PATH is an earlier version.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Ok, thanks. I found out it was net5 problems because Rider threw a bunch of errors but the batch scripts worked. The msbuild in my PATH is an earlier version.
    Did you get further? Are there any questions I can answer?

    Gesendet von meinem SM-G930F mit Tapatalk
     

    da3dsoul

    Retired Team Member
  • Team MediaPortal
  • August 29, 2020
    86
    45
    Home Country
    United States of America United States of America
    Not worked on it much over the weekend. I found the stuff in the client solution. I have not yet gotten the client to run from a build. Currently, it complains about win not being in the runtime identifiers, but I think there's a way to tell MSBuild to STFU and use a default. Normally, I'd just add win to the runtime identifiers, but there's so many projects that I expect it'll just be a rabbit hole.
     

    da3dsoul

    Retired Team Member
  • Team MediaPortal
  • August 29, 2020
    86
    45
    Home Country
    United States of America United States of America
    I've gotten some stuff to work. I've done a decent bit of work adding the small modifications to allow newer MSBuild releases to work with the projects. I'm still working on getting the rest. I didn't have the right C++ stuff for Online Videos's native libs and I didn't have WiX installed, so I'm figuring those out.

    Update: Got all of that. Now it's not building the x64 from the MSBUILD_Create_Full_Installer_NoTransifex.bat.
    Code:
           "C:\Users\da3ds\Documents\GitHub\MediaPortal-2\MediaPortal\Build\Build.proj" (default target) (1) ->
           "C:\Users\da3ds\Documents\GitHub\MediaPortal-2\MediaPortal\Setup\MP2-Setup.sln" (Rebuild target) (137) ->
           "C:\Users\da3ds\Documents\GitHub\MediaPortal-2\MediaPortal\Setup\MP2-Setup\MP2-Setup.wixproj.metaproj" (Rebuild
           target) (138) ->
           "C:\Users\da3ds\Documents\GitHub\MediaPortal-2\MediaPortal\Setup\MP2-Setup\MP2-Setup.wixproj" (Rebuild target) (
           141) ->
           (Link target) ->
             C:\Users\da3ds\Documents\GitHub\MediaPortal-2\MediaPortal\Setup\MP2-Setup\Features\Client.wxs(76): error LGHT0
           103: The system cannot find the file 'C:\Users\da3ds\Documents\GitHub\MediaPortal-2\MediaPortal\Bin\MP2-Client\b
           in\Release\MP2-Client (x64).exe'. [C:\Users\da3ds\Documents\GitHub\MediaPortal-2\MediaPortal\Setup\MP2-Setup\MP2
           -Setup.wixproj]
    
        729 Warning(s)
        1 Error(s)
     
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    I had such issue before, that the x64 build is not executed sometimes. Until now I could not figure out the cause for this. On our Team City continous integration system all builds fine.

    The related project section is: MediaPortal/MediaPortal-2. There are only 2 projects included in the "ProjectsToBuildX64" group. Do you see any issue with this?
     

    da3dsoul

    Retired Team Member
  • Team MediaPortal
  • August 29, 2020
    86
    45
    Home Country
    United States of America United States of America
    It's a known issue? I am now stopping the installation of another 10GB of EOL SDK packages. Aaand that was 24.3GB of temporary installation files from VS build tools.... Good riddance. I'm not generally stingy with space, but that's an entire game's worth of storage for something that should be 5GB at the most.

    I don't know what you mean by "Do you see any issue with this?" I didn't change it.
     

    Users who are viewing this thread

    Top Bottom