Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove hard dependency on inputstream.adaptive.
- Loading branch information
Showing
3 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please test if this works with your various shortcut addons, @primaeval ?
In theory, whenever a new directory is created, it will check the availability of inputstream.adaptive, if stream_protocol is set to 0 (DASH). If it isn't available, or the version is too low, it will change the setting back to HLS.
I am not sure about the performance impact this has. It feels extremely slow since I introduced this patch, but this may also just be server load.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's going to need another function to play the individual streams so that the inputstream.adaptive properties get added to the ListItem at the last minute before playing, just like PlayStream does in ipwww_video.py.
plugin.video.iplayerwww/resources/lib/ipwww_video.py
Line 1304 in e7aca5e
If you look at the normal Kodi favourites.xml there is only a link there not a complete ListItem.
inputstream.rtmp has done it the right way by listing the protocols as file name extensions
https://github.com/notspiff/inputstream.rtmp/blob/master/inputstream.rtmp/addon.xml.in
but inputstream.adaptive hasn't
https://github.com/peak3d/inputstream.adaptive/blob/master/inputstream.adaptive/addon.xml.in
If the link is to another mode= url for dash that uses the resolvedURL method with the inputstream.adaptive properties that would work fine for any shortcut: Favourites or otherwise.
It is a pain but that is the way it's been implemented so we have to move the mountain or move Mohammed.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resetting it in PlayStream is not going to work. At that point of time we are no longer able to switch back to HLS. The best we could do at that point of time is to abort the playback.
If somebody created a shortcut to a DASH stream it would stick. However, if they attempt to create the directory item and then a shortcut, it will switch to HLS before creating the directory. Thus, the shortcut will also point to HLS.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got confused with my addon where I just use the raw urls if autoplay is off.
As everything does go through PlayStream to play I think it should look at the stream url to work out the protocol. If it ends with mpd before the # suffix it can just set the inputstream.adaptive properties without looking at the Setting.
That should work as any shortcut or favourite link.
You could pass another parameter to PlayStream for the hls/dash/etc protocol if you really want to be sure it picks the right one, or make a PlayStreamDash.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The individual links would probably best be called something that shows the protocol so it is obvious that if you disable inputstream.adaptive the link won't work any more. eg
BBC One - DASH Akamai https
or nicer.
In most of my addons I do a fuzzy channel match for the channel including number to word conversions so something like "Bbc1" will match "BBC One DASH" or "Channel 1. BBC 1 London". I ignore case and space.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is: IIRC, that does not work. If autoplay is on, the property to use inputstream.adaptive needs to be set for the directory/playable already. It can no longer be modified after the user clicks on the directory (or shortcut). That's why these properties also get set on a directory/item level qnd not just within PlayStream. The same issue blocks an automatic fallback for programmes which are not available as DASH streams.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried that when experimenting with the automatic fallback. Something like returning an extra option or include a suffix in the name. Didn't work either, see last post.
The way Kodi invokes different players from addons is seriously f****d up at the moment.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to think of a robust way to do this that handles all of Kodi's quirks.
Most of this is obvious but let's check the logic is right.
We can't rely on https working in Jarvis.
We can't rely on inputstream.adaptive being available on every platform.
There are really two main Play modes: Autoplay and Manual.
In Autoplay nothing needs to be added to the ListItems in the directory or shortcuts in favourites.
It can all depend on the current Settings and whether inputstream.adaptive is enabled.
In Manual we reveal all the possible links based on the Stream filters and allow users to make direct links to the stream variants.
The Autoplay pseudocode is something like:
If the user plays a Manual stream Shortcut after disabling inputstream.adapative:
tough luck, it just won't work
Manual is for advanced users and debugging so expect users to have to think a bit
The Directory listing needs to hold off adding anything about protocols.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being quite. Been away again.
I get what you want to do. The problem is that there is not a single entry point like your Autoplay(episode_url). The closest thing I can think of right now is ParseStreamsHLSDASH, AddAvailableLiveStreamItemSelector and AddAvailableLiveStreamsDirectory.
I think this would work for live TV as the decision whether to use DASH or HLS is made before the final directory item is created. However, for catchup in Autoplay, ParseStreamsHLSDASH will be called by AddAvailableStreamItem and the corresponding directory item already is set to play with InputStream Adaptive.
I will give this a try, but I believe this will fail on catchup Autoplay.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a priority now that Kodi 17.2 hasn't got inputstream.adaptive.
Maybe the solution is just to remove version 3 from the repo and bump version 2 to 4 until inputstream.adaptive returns.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean until it returns? Has it really been removed? Or has just the option moved?
BTW: I don't understand why, but it does seem to work. Will push a commit shortly, please test.
Edit: See 2dfdef1
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has totally gone from the system addons folder in Windows and Android at least.
inputstream.adaptive does not exists in Kodi 17.2.
e7aca5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few binary add-ons that are missing or not building correctly due to a lack of Krypton tagging from authors in repo's. inputstream.adaptive will be corrected for 17.3 release.