Help with external player I'm trying to write a playercorefactory.xml file that will automatically open a particular file in VLC player (this one particular file will not play in Kodi). This is what I have so far. Download playercorefactory xml files found Uploaded on TraDownload and all major free file sharing websites like 4shared.com, uploaded.to, mediafire.com and many others. After clicking desired file title click download now button or copy download link to browser and wait certain amount of time (usually up to 30 seconds) for download to begin.
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
commented Aug 11, 2018 • edited
edited
DescriptionWhen you define an playercorefactory.xml file with an rule the behaviour should be:
But the behaviour is:
Motivation and ContextBecause its an bug. Here is the trac ticket: https://trac.kodi.tv/ticket/17983#ticket And the forum thread post: https://forum.kodi.tv/showthread.php?tid=43511&pid=2757968#pid2757968 How Has This Been Tested?Test on my local dev PC and on my main HTPC. All tests was positive that the bug is fixed. Screenshots (if appropriate):Types of change
Checklist:
|
reviewed Aug 11, 2018
@@ -115,7 +115,16 @@ bool CApplicationPlayer::OpenFile(const CFileItem& item, const CPlayerOptions& o | |
returntrue; | |
} | |
} | |
Aug 11, 2018
force-pushed the popy2k14:External-Player-Fix branch from 45407c9
to c88bc7a
Aug 11, 2018
reviewed Aug 12, 2018
@@ -116,6 +116,15 @@ bool CApplicationPlayer::OpenFile(const CFileItem& item, const CPlayerOptions& o | |
} | |
} | |
//check if player has changed? | |
if (player && (player->m_name != newPlayer)) |
Aug 12, 2018
why do we have a player here? old one should have been released in ClosePlayer
Aug 12, 2018
A few lines above the Current player will be retrieved with GetInternal() then is a check if player != null and if it's playing... Some code. So in most cases it isn't playing and the if isn't executed. New player then isn't created because it's not null.
My code just releases it when the player name changed.
I'll think the code is not straight forward in some cases.
The m_player has to be null that a new player is created.
But which function closes it?
Aug 12, 2018
I have tracked it down that m_player is definitely not released. In openFile on the GetInternal call a player is returned and worked with. That's the reason why not the correct player is created and assigned to m_player.
Aug 12, 2018
I still don't understand what's exactly going on here. If I start a video and stop it, the player is released on ClosePlayer. Next time I open a file, there is no player instance. Is this different on your system? Why?
Aug 12, 2018
Please try the following:
- setup PCF with my xml from the ticket
- create a bat file under c:temptest.bat with the content:
@echo off
echo Playing '%1'
pause
echo Playing '%1'
pause
- Ensure that you have a movie in your DB with '4K' in the filename (without quotes)
- start latest kodi nightly
- play a movie (which NOT has 4K in it) ->Video Player should open
- press X to stop it
- play another movie (which NOT has 4K in it) ->Video Player should open
- press X to stop it
- play a movie which HAS 4K in its filename -> test.bat should open
- until here all is ok
- play the first movie (which NOT has 4K in it) ->Video Player should open
- But sadly until now EVERY movie is opened in the external player (batch file in our case)
Thats the issue!
I have debugged it and found out that 'player', at the lines where i have commited the new code, has a reference to the last player (in our case MPC-HC or our batch file). This reference comes from the function GetInternal() which returns the global m_Player variable.
I'll think the problem is that 'player' will be filled with the retuirn value of GetInternal and worked with but not released.
I'll think the problem is that 'player' will be filled with the retuirn value of GetInternal and worked with but not released.
Just when 'player' is null, a new player is created.
My fix now checks the name of the player and releases it if it differs from the new/reqeuested one.
pOpY
Aug 12, 2018
If this happens we have another issue to fix. When a video is stopped, ClosePlayer should be called. This seems not to be the case for external player, otherwise player would be released.
Aug 13, 2018 •
You are right, have looked at the code in the Application.cpp at:
void CApplication::StopPlaying()
{
int iWin = CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow();
if (m_appPlayer.IsPlaying())
{
m_appPlayer.ClosePlayer();
{
int iWin = CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow();
if (m_appPlayer.IsPlaying())
{
m_appPlayer.ClosePlayer();
So when is StopPlaying() called, i assume when the inputmanager gets an stop key.
I'll think the issue could be that:
- External Player will be launched -> seperate thread starts and executes (Process function) until the external application is stopped
- Any other application (Harmony Remote, Yatse) is closing the external app WITHOUT sending stop to kodi
- kodi doesn't call the StopPlaying() so the player isnt released.
I am not so deep in the kodi kodi than you.
Can you confirm that?
Can you confirm that?
My idea is that the stopping external player thread threaf is releasing the ApplicationPlayer (=m_pPlayer variable) or calling StopPlaying().
Aug 13, 2018
what do you think of adding ClosePlayer() to the end of the Process function of ExternalPlayer.cpp:
Playercorefactory Xml Download Free
// When external player is closed NOT with kodi stop function ClosePlayer() doesn't get called > and the player isn't released
g_application.GetAppPlayer().ClosePlayer();
g_application.GetAppPlayer().ClosePlayer();
if (!ret || (m_playOneStackItem && g_application.CurrentFileItem().IsStack()))
m_callback.OnPlayBackStopped();
else
m_callback.OnPlayBackEnded();
}
m_callback.OnPlayBackStopped();
else
m_callback.OnPlayBackEnded();
}
Aug 13, 2018
Aug 13, 2018
Nice find @Rechi
Tested and working here also.
Changed PR will come soon...
Tested and working here also.
Changed PR will come soon...
Fix for (external)player from playercorefactory.xml gets the default …
force-pushed the popy2k14:External-Player-Fix branch from c88bc7a
to dbe64f1
Aug 13, 2018
commented Aug 13, 2018 • edited
edited
@FernetMenta & @Rechi PR updated, review and merge please. |
commented Aug 14, 2018
thanks! |
merged commit d270e1b
into xbmc:masterAug 14, 2018
1 check passed
added Type: FixComponent: VideoPlatform: Windowsv18 Leia labels Aug 14, 2018
added this to the Leia 18.0-beta1 milestone Aug 14, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.
I use TVMC for streaming online content on my android mobile and android tablet. TVMC is a flavour of the XBMC Kodi build. TVMC is basically Kodi with all the best plugins/addons pre-installed.
I initially downloaded Kodi but felt overwhelmed at the amount of reading/searching I had to do to find the best plugins to steam content. TVMC comes with everything included and is basically plug and play!
##Casting from android mobile/tablet to chromecastThere doesn't seem to be a built in way to cast from TVMC to a chromecast but there is a hack!
####Step 1.Download a casting app for your device. I use AllCast
You could us a different casting application such as LocalCast
####Step 2.Download the playercorefactory.xml file which is part of this repository.
This file is already set up to cast using the AllCast app. If you want to change it to a different app for casting, just edit the bottom part of the file. You will need to substitute the 'Allcast' key with the name of the casting app which you want to use.
####Step 3.You will need to find the TVMC installation directory on your device. We will copy the file above to a certain directory. On my Samsung S5 the directory we need can be found at:
/sdcard/Android/data/ag.tvaddons.tvmc/files/.xbmc/userdata/
Copy the playercorefactory.xml file to the directory above.
I use an app for directory navigation and for copying files:ES File Explorer
Note: When using a file explorer app the above directory includes the hidden directory '.xbmc'. Some file explorer apps will not show this directory by default. ES File Explorer has a 'show hidden files' button which shows hidden files! You will need to turn this on in order to find the correct directory.
####Step 4.Restart your TVMC app.
####Step 5.Select content to stream, choose AllCast when prompted to choose a player, select your chromecast and sit back and relax!
###Tips and tricksIf the playercorefactory.xml file exists in the directory above, everytime you attempt to stream content, the AllCast app will be opened. If you want to view the content on your device only you will need to remove the playercorefactory.xml file from the above directory.
If I want to watch content on my device I rename the playercorefactory.xml file in the 'userdata' directory and restart TVMC. I usually just add a letter to the '.xml' part to be 'playercorefactory.xmlt'. If I want to use AllCast for streaming again I rename the file to be 'playercorefactory.xml' again.
I plan on writing a simple android app for this at some stage but using ES file explorer works ok for now.