Extracting live TV channels from an m3u file by differentiating them from VOD content

Currently, I am developing an IPTV player app and have successfully parsed the m3u file. My current challenge is separating live TV channels from Video on Demand (VOD). I am unsure of where exactly the transition happens in the playlists.

Below are the keys for each object after the parsing process:

[ 'duration', 'title', 'tvgId', 'tvgName', 'tvgLogo', 'groupTitle' ]
I am utilizing NestJS and the m3u8-file-parser library for m3u parsing.

Answer №1

When it comes to HLS video, the specification doesn't provide a clear way to distinguish between live and non-live content. This can lead to confusion among users.

The HLS specification outlines three types of streams: VOD, LIVE, and EVENT.

  • VOD streams are characterized by:

    • The m3u8 manifest containing the tag #EXT-X-PLAYLIST-TYPE:VOD
    • A static playlist that does not change
    • Inclusion of all video segments in the playlist
  • LIVE streams feature:

    • No presence of the EXT-X-PLAYLIST-TYPE tag
    • A playlist that evolves over time, requiring periodic re-requesting by the client/player
    • A 'sliding window' approach with old segments being replaced by new ones as the video progresses
  • EVENT streams are identified by:

    • The EXT-X-PLAYLIST-TYPE: EVENT tag
    • A playlist that grows continuously from the start of the event until the present moment, without any segments falling off

It's essential to differentiate between the LIVE stream type and the conventional understanding of 'liveness'. While a LIVE stream indicates a dynamic presentation with segment updates, traditional 'liveness' embodies the idea that the video content is current or very recent.

Some commercial HLS servers use a combination of live and prerecorded content by merging segments into a single stream under the LIVE stream type. However, determining real-time 'liveness' in HLS content often requires custom indicators from the stream originator, which may not be common practice.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

steps for adding text to the header with selenium webdriver

I came across the following code snippet: <body> <table> <tr> <td style= "width:30%;"> <img class = "new" src="images/new-icon.png"> <td> <h1>Hello there!</h1> ...

Sort table rows by checkbox value in javascript

Is there a way to use javascript or JQuery to group the rows in this table by Office or Age based on the checkbox option selected? For example, if the Office checkbox is checked, the table rows should be grouped by Office. If the Age checkbox is checked, ...

Saving Files in Your React Web Application: Tips and Tricks

Currently, I am working on a React web application that requires the temporary storage of Torrent pieces for streaming purposes using a web player. Any recommendations on how to properly store this data temporarily in order to facilitate the streaming pro ...

How to extract a section of a string with AngularJS

Can someone help me figure out how to remove the last part of a string in order to obtain just the main word? For example, turning string(1) into string. Any suggestions would be appreciated! PS. Note that the string might look like this: sringggg(125). ...

Is it a suboptimal method to repeatedly use order.find, collect data, and transmit a substantial data payload to the front end in

Currently, I am working with Express, React, and MongoDB but I am relatively new to using express and REST API. My goal is to add an analytics feature to my frontend that focuses on sales and orders. The plan is to allow users to search within a specified ...

Tips for implementing Javascript form validation

While working on a Django form, I encountered an issue with implementing javascript logic. My goal is to submit the form if the input field is not empty. However, I am struggling to determine how to identify the id of {{form.value}}. <form id = " ...

Creating a calculator with JQuery and encountering challenges with performing multiple calculations

I've been working on a calculator using jQuery, but I'm encountering issues with the clear button not functioning properly after multiple calculations. On top of that, subsequent calculations are producing inaccurate results. I am seeking to enh ...

Retrieving data from a JSON file at 10-minute intervals with Ajax and visualizing it on Google's globe API

After downloading Armsglobe, a globe API provided by Google to draw lines in countries using their names, I noticed that the original code does not fetch JSON data periodically. I attempted to use a simple setTimeout() function in dataloading.js to address ...

Filtering out undefined elements from an array created by mapping over a nested array using map() and filter()

I'm currently in the process of creating multiple variables to be utilized later on, each one representing a specific array within a set of nested arrays (essentially a data array that will be used for various projects). As I attempt to select the pr ...

What is the best way to assign a URL to an image source using a JavaScript variable?

I am working on a script that displays different image URLs based on the time of day using an if-else statement. I want to dynamically load these images in an img src tag so that a different picture is loaded for each time of day. I have defined variables ...

How can I implement a redirect function for Carousel image clicks in a React project?

I am working on a React project that includes Carousel from the 'react-responsive-carousel' npm package. I am looking to implement a functionality where clicking on the images in the Carousel will redirect to another component. How can this be ac ...

error TS2339: The attribute 'properties' is not accessible on the class 'TestPage'

Utilizing a typescript abstract class as the base class of my layout component in React has been essential for my project. The implementation of this base class looks something like this: import { IPageLayoutActions, IPageLayoutLocalState, IPageLayoutProp ...

Custom JavaScript function throwing an error

function changeElementClass(path, changeClass, duration){ $(path).removeClass(changeClass); $(this).addClass(changeClass); )}; $('.flightDetails .option').changeElementClass('.flightDetails .option','selected',300); ...

Using jQuery to load the center HTML element

So here's the plan: I wanted to create a simple static website with responsive images that load based on the browser width. I followed some suggestions from this link, but unfortunately, it didn't work for me. I tried all the answers and even a ...

Error when attempting to add data into MongoDB using Node.JS: "The type 'string' cannot be assigned to type 'ObjectId | undefined'."

Attempting to add a document to the collection results in an error when specifying the _id field of the added document. How can I insert a document with an _id that is not an ObjectId? The error occurs with the following code. Omitting the _id resolves th ...

In my React JS project, I am using an <Add /> component on two distinct pages. However, I am encountering an issue where only one of the pages is correctly receiving the add count prop

I could use some assistance in understanding why the logic for my counter button is not functioning properly on one specific instance. My aim is to have the count displayed by the counter look like this: https://i.sstatic.net/VdJ8o.png In order to add it ...

Dynamic Node.js server constantly updating

My goal is to create a dynamic Node.js Express server that updates live, possibly by creating a specific route like /update to load a new configuration file. My concern is that the server could be in any state when the update occurs. It's possible tha ...

Matching exact multiple words with special characters using Javascript Regular Expression

My issue involves using RegExp to match multiple words with dynamic values. Whenever a special character like "(" is included, it interprets it as an expression and throws an Uncaught SyntaxError: Invalid regular expression error. let text = 'worki ...

Node-red occasionally crashes and the JSON output may unexpectedly return HTML content

Having some trouble with my node-red crashing several times a day. I suspect that one of the issues may be related to an http request I am making. I'm trying to retrieve JSON data from a webpage, but sometimes I encounter errors in the log indicating ...

TS7030: In Angular13, ensure that all code paths within the guard and canActivate methods return a value

Having trouble using guards for an unlogged user and constantly facing errors. Error: TS7030 - Not all code paths return a value. Below is my auth.guard.ts file: import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree} from &a ...