diff --git a/README.md b/README.md index 4a64640e..81b89d08 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,7 @@ Addon settings for catchup: - `with and without catchup mode (all channels)` - Include all channels ignoring any catchup mode from the M3U. * **Catchup correction**: Adjust the time used for catchup stream URL generation by this value, from -12 hours to +14 hours. Useful for catchup streams which are geo mis-matched to the wrong time. Note that this value can be overridden by values in the M3U file, see [Supported M3U and XMLTV elements](#supported-m3u-and-xmltv-elements). * **Play from EPG in Live TV mode (using timeshift)**: When disabled any catchup show from the past will be played like a video (bounded by start and end times). If enabled, it will instead act like a live stream with timeshift, also allowing the ability to skip back and forward programmes. Note that the only effect this option has on streams that do not support timeshifting is whether or not to apply the before/after buffer. +* **Play from Live TV in EPG mode (video playback)**: When disabled any catchup channel will be played using the Live OSD. If enabled, it will instead act like a video (bounded by start and end times), also allowing the ability to skip back and forward programmes, if the previous and next programmes support catchup. * **Buffer before programme start**: The amount of buffer to give before the playback start point of an EPG entry that will be watched as a video. * **Buffer after programme end**: The amount of buffer to give after the playback end point of an EPG entry that will be watched as a video. * **Catchup only available on finished programmes**: When selected from the EPG the current live programme cannot be watched as catchup until finished. diff --git a/pvr.iptvsimple/resources/instance-settings.xml b/pvr.iptvsimple/resources/instance-settings.xml index a55fb848..dd61efad 100644 --- a/pvr.iptvsimple/resources/instance-settings.xml +++ b/pvr.iptvsimple/resources/instance-settings.xml @@ -819,6 +819,14 @@ + + 0 + false + + true + + + 0 5 diff --git a/pvr.iptvsimple/resources/language/resource.language.en_gb/strings.po b/pvr.iptvsimple/resources/language/resource.language.en_gb/strings.po index a19e9c82..0abf7ca9 100644 --- a/pvr.iptvsimple/resources/language/resource.language.en_gb/strings.po +++ b/pvr.iptvsimple/resources/language/resource.language.en_gb/strings.po @@ -598,7 +598,12 @@ msgctxt "#30128" msgid "Catchup correction" msgstr "" -#empty strings from id 30129 to 30449 +#. label: Catchup - catchupPlayLiveAsEpg +msgctxt "#30129" +msgid "Play from Live TV in EPG mode (video playback)" +msgstr "" + +#empty strings from id 30130 to 30449 #. category-lavel: Media #. group-label: Media - Media @@ -1024,7 +1029,12 @@ msgctxt "#30710" msgid "Adjust the time used for catchup stream URL generation by this value, from -12 hours to +14 hours. Useful for catchup streams which are geo mis-matched to the wrong time. Note that this value can be overridden by values in the M3U file." msgstr "" -#empty strings from id 30711 to 307019 +#. help: Catchup - catchupPlayLiveAsEpg +msgctxt "#30711" +msgid "When disabled any catchup channel will be played using the Live OSD. If enabled, it will instead act like a video (bounded by start and end times), also allowing the ability to skip back and forward programmes, if the previous and next programmes support catchup." +msgstr "" + +#empty strings from id 30712 to 307019 #. help info - Timeshift diff --git a/src/IptvSimple.cpp b/src/IptvSimple.cpp index 28b69707..81d3f57b 100644 --- a/src/IptvSimple.cpp +++ b/src/IptvSimple.cpp @@ -216,8 +216,11 @@ PVR_ERROR IptvSimple::GetChannels(bool radio, kodi::addon::PVRChannelsResultSet& return m_channels.GetChannels(results, radio); } -PVR_ERROR IptvSimple::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, std::vector& properties) +PVR_ERROR IptvSimple::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, PVR_SOURSE source, std::vector& properties) { + Logger::Log(LogLevel::LEVEL_INFO, "%s - XXXXX fromEpgAsLive: %d", __FUNCTION__, source); + + if (GetChannel(channel, m_currentChannel)) { std::string streamURL = m_currentChannel.GetStreamURL(); @@ -436,6 +439,15 @@ PVR_ERROR IptvSimple::GetSignalStatus(int channelUid, kodi::addon::PVRSignalStat return PVR_ERROR_NO_ERROR; } +/*************************************************************************** + * Stream State + **************************************************************************/ + +void IptvSimple::StreamClosed() +{ + Logger::Log(LEVEL_INFO, "%s - XXXX Stream Closed", __FUNCTION__); +} + /*************************************************************************** * InstanceSettings **************************************************************************/ diff --git a/src/IptvSimple.h b/src/IptvSimple.h index 11c31535..ed49ec56 100644 --- a/src/IptvSimple.h +++ b/src/IptvSimple.h @@ -57,7 +57,7 @@ class ATTR_DLL_LOCAL IptvSimple : public iptvsimple::IConnectionListener PVR_ERROR GetChannelsAmount(int& amount) override; PVR_ERROR GetChannels(bool radio, kodi::addon::PVRChannelsResultSet& results) override; - PVR_ERROR GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, std::vector& properties) override; + PVR_ERROR GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, std::vector& properties, bool fromEpgAsLive) override; PVR_ERROR GetChannelGroupsAmount(int& amount) override; PVR_ERROR GetChannelGroups(bool radio, kodi::addon::PVRChannelGroupsResultSet& results) override; @@ -71,6 +71,8 @@ class ATTR_DLL_LOCAL IptvSimple : public iptvsimple::IConnectionListener PVR_ERROR GetSignalStatus(int channelUid, kodi::addon::PVRSignalStatus& signalStatus) override; + void StreamClosed() override; + PVR_ERROR GetRecordingsAmount(bool deleted, int& amount) override; PVR_ERROR GetRecordings(bool deleted, kodi::addon::PVRRecordingsResultSet& results) override; PVR_ERROR GetRecordingStreamProperties(const kodi::addon::PVRRecording& recording, std::vector& properties) override; diff --git a/src/iptvsimple/CatchupController.cpp b/src/iptvsimple/CatchupController.cpp index 2c04a279..a89eceef 100644 --- a/src/iptvsimple/CatchupController.cpp +++ b/src/iptvsimple/CatchupController.cpp @@ -63,6 +63,9 @@ void CatchupController::ProcessChannelForPlayback(const Channel& channel, std::m { m_programmeCatchupId = liveEpgEntry->GetCatchupId(); UpdateProgrammeFrom(*liveEpgEntry, channel.GetTvgShift()); + + if (m_settings->CatchupPlayLiveAsEpg()) + catchupProperties.insert({PVR_STREAM_PROPERTY_LIVEPLAYBACKASEPG, "true"}); } } } diff --git a/src/iptvsimple/InstanceSettings.cpp b/src/iptvsimple/InstanceSettings.cpp index 612fbebf..4d55d77a 100644 --- a/src/iptvsimple/InstanceSettings.cpp +++ b/src/iptvsimple/InstanceSettings.cpp @@ -143,6 +143,7 @@ void InstanceSettings::ReadSettings() m_instance.CheckInstanceSettingEnum("catchupOverrideMode", m_catchupOverrideMode); m_instance.CheckInstanceSettingFloat("catchupCorrection", m_catchupCorrectionHours); m_instance.CheckInstanceSettingBoolean("catchupPlayEpgAsLive", m_catchupPlayEpgAsLive); + m_instance.CheckInstanceSettingBoolean("catchupPlayLiveAsEpg", m_catchupPlayLiveAsEpg); m_instance.CheckInstanceSettingInt("catchupWatchEpgBeginBufferMins", m_catchupWatchEpgBeginBufferMins); m_instance.CheckInstanceSettingInt("catchupWatchEpgEndBufferMins", m_catchupWatchEpgEndBufferMins); m_instance.CheckInstanceSettingBoolean("catchupOnlyOnFinishedProgrammes", m_catchupOnlyOnFinishedProgrammes); @@ -319,6 +320,8 @@ ADDON_STATUS InstanceSettings::SetSetting(const std::string& settingName, const return SetSetting(settingName, settingValue, m_catchupCorrectionHours, ADDON_STATUS_OK, ADDON_STATUS_OK); else if (settingName == "catchupPlayEpgAsLive") return SetSetting(settingName, settingValue, m_catchupPlayEpgAsLive, ADDON_STATUS_OK, ADDON_STATUS_OK); + else if (settingName == "catchupPlayLiveAsEpg") + return SetSetting(settingName, settingValue, m_catchupPlayLiveAsEpg, ADDON_STATUS_OK, ADDON_STATUS_OK); else if (settingName == "catchupWatchEpgBeginBufferMins") return SetSetting(settingName, settingValue, m_catchupWatchEpgBeginBufferMins, ADDON_STATUS_OK, ADDON_STATUS_OK); else if (settingName == "catchupWatchEpgEndBufferMins") diff --git a/src/iptvsimple/InstanceSettings.h b/src/iptvsimple/InstanceSettings.h index 7ed875b8..386a7306 100644 --- a/src/iptvsimple/InstanceSettings.h +++ b/src/iptvsimple/InstanceSettings.h @@ -164,6 +164,7 @@ namespace iptvsimple float GetCatchupCorrectionHours() const { return m_catchupCorrectionHours; } int GetCatchupCorrectionSecs() const { return static_cast(m_catchupCorrectionHours * 60 * 60); } bool CatchupPlayEpgAsLive() const { return m_catchupPlayEpgAsLive; } + bool CatchupPlayLiveAsEpg() const { return m_catchupPlayLiveAsEpg; } int GetCatchupWatchEpgBeginBufferMins() const { return m_catchupWatchEpgBeginBufferMins; } time_t GetCatchupWatchEpgBeginBufferSecs() const { return static_cast(m_catchupWatchEpgBeginBufferMins) * 60; } int GetCatchupWatchEpgEndBufferMins() const { return m_catchupWatchEpgEndBufferMins; } @@ -329,6 +330,7 @@ namespace iptvsimple CatchupOverrideMode m_catchupOverrideMode = CatchupOverrideMode::WITHOUT_TAGS; float m_catchupCorrectionHours = 0; bool m_catchupPlayEpgAsLive = false; + bool m_catchupPlayLiveAsEpg = false; int m_catchupWatchEpgBeginBufferMins = 5; int m_catchupWatchEpgEndBufferMins = 15; bool m_catchupOnlyOnFinishedProgrammes = false;