Skip to content

Commit

Permalink
Add setting to play Live TV using the video OSD, for Catchup VOD play…
Browse files Browse the repository at this point in the history
…back
  • Loading branch information
phunkyfish committed Feb 20, 2024
1 parent 3d019a4 commit d66310e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions pvr.iptvsimple/resources/instance-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,14 @@
</dependencies>
<control type="toggle" />
</setting>
<setting id="catchupPlayLiveAsEpg" type="boolean" label="30129" help="30711">
<level>0</level>
<default>false</default>
<dependencies>
<dependency type="enable" setting="catchupEnabled" operator="is">true</dependency>
</dependencies>
<control type="toggle" />
</setting>
<setting id="catchupWatchEpgBeginBufferMins" type="integer" parent="catchupPlayEpgAsLive" label="30107" help="30706">
<level>0</level>
<default>5</default>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions src/iptvsimple/CatchupController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"});
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/iptvsimple/InstanceSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void InstanceSettings::ReadSettings()
m_instance.CheckInstanceSettingEnum<CatchupOverrideMode>("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);
Expand Down Expand Up @@ -319,6 +320,8 @@ ADDON_STATUS InstanceSettings::SetSetting(const std::string& settingName, const
return SetSetting<float, ADDON_STATUS>(settingName, settingValue, m_catchupCorrectionHours, ADDON_STATUS_OK, ADDON_STATUS_OK);
else if (settingName == "catchupPlayEpgAsLive")
return SetSetting<bool, ADDON_STATUS>(settingName, settingValue, m_catchupPlayEpgAsLive, ADDON_STATUS_OK, ADDON_STATUS_OK);
else if (settingName == "catchupPlayLiveAsEpg")
return SetSetting<bool, ADDON_STATUS>(settingName, settingValue, m_catchupPlayLiveAsEpg, ADDON_STATUS_OK, ADDON_STATUS_OK);
else if (settingName == "catchupWatchEpgBeginBufferMins")
return SetSetting<int, ADDON_STATUS>(settingName, settingValue, m_catchupWatchEpgBeginBufferMins, ADDON_STATUS_OK, ADDON_STATUS_OK);
else if (settingName == "catchupWatchEpgEndBufferMins")
Expand Down
2 changes: 2 additions & 0 deletions src/iptvsimple/InstanceSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ namespace iptvsimple
float GetCatchupCorrectionHours() const { return m_catchupCorrectionHours; }
int GetCatchupCorrectionSecs() const { return static_cast<int>(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<time_t>(m_catchupWatchEpgBeginBufferMins) * 60; }
int GetCatchupWatchEpgEndBufferMins() const { return m_catchupWatchEpgEndBufferMins; }
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d66310e

Please sign in to comment.