How does #EXT-X-DISCONTINUITY-SEQUENCE tag work in HLS m3u8 file - http-live-streaming

I'm inspecting about #EXT-X-DISCONTINUITY-SEQUENCE tag in m3u8 file of HLS.
(https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-23#section-4.3.3.3)
Does somebody can explain the working way of it?
For example, let's suppose that m3u8 file is made for live streaming like below,
After 2 seconds segment1.060.ts, file.000.ts will be gone from list and #EXT-X-DISCONTINUITY tag too.
after all file.001.ts is going to be first media segment in the list.
At this state, what sequence number should be in #EXT-X-MEDIA-SEQUENCE, #EXT-X-DISCONTINUITY-SEQUENCE?
#EXT-X-DISCONTINUITY should be put in front of file.001.ts line again?
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:60
#EXT-X-DISCONTINUITY-SEQUENCE:0
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:2
#EXTINF:0.933600,
segment1.060.ts
#EXT-X-DISCONTINUITY
#EXTINF:0.966911,
file.000.ts
#EXTINF:1.000489,
file.001.ts

The reason why EXT-X-DISCONTINUITY-SEQUENCE must be used for synchronization across variants is explained in the standard:
A client MUST NOT assume
that segments with the same Media Sequence Number in different Media
Playlists contain matching content
and
A client MUST NOT assume that segments with the same Media Sequence
Number in different Variant Streams or Renditions have the same
position in the presentation; Playlists MAY have independent Media
Sequence Numbers. Instead, a client MUST use the relative position
of each segment on the Playlist timeline and its Discontinuity
Sequence Number to locate corresponding segments.
Back to your question:
EXT-X-DISCONTINUITY marks a discontinuity between two consecutive segments. Your discontinuity is between segment1.060.ts and file.000.ts. There is no discontinuity between file.000.ts and file.001.ts so no need to re-insert the tag
each time you remove a EXT-X-DISCONTINUITY from the playlist you must increment the EXT-X-DISCONTINUITY-SEQUENCE
each time you remove a segment from the playlist you must increment the EXT-X-MEDIA-SEQUENCE

Related

VXML audio file playing status

I have a VXML (say vxml-1) which contains simple audio file for announcement followed by a goto element pointing to next vxml doc(say vxml-2) containing another audio file for announcement. Once the execution starts, vxml-1 loads with corresponding audio followed by goto execution. Now when the user hangs up, in the background it shows that it ended at vxml-2 because of very fast goto transition, but actually the user hung up at the audio of vxml-1 because of its long length. How can I determine if the user actually hung in between of audio of vxml-1 ? Is there any inbuilt function or property of audio tag like start or end in VXML ?
Because of the way voice xml documents are processed, both audio files are queued (ie both pages executed) before the customer even notices audio is playing.
To accomplish what you want, create a form on the first page with an input (any input grammar will do) with a very short timeout. That way, the user doesn't navigate to the next page until they audio file has played and the timeout expired.
Note, the timeout and page navigation will add a delay. You can keep the timeout short, but the platform and page complexity determine how long it takes to navigate to the next page. To try and minimize the delay, make sure your audio files a trimmed of silence at the beginning and end.

Get value within TV’s html attribute in Modx

I’m new to Modx so I don’t know if this is possible or not.
My TV, in this case [[*myTV]] outputs the following:
<data value='www.mylink.com'>Description</data>
Is there a way to only display the data value in the front-end? In this case I just want to display the url.
My recommendation would be to keep the data (in this case the URL) and the html separate, and that might help your situation. If the TV only includes the URL itself, then it makes it much easier to deal with the output of the TV using output modifiers. As an example, if [[*myTV]] contains www.mylink.com for a particular resource and you want the original output in your question, you could do something like:
[[*myTV:default=`<data value='[[*myTV]]'>Description</data>`]]
You can also nest TVs within output modifiers, so if for example you had a corresponding [[*description]] TV that describes the URL in [[*myTV]], you could use:
[[*myTV:default=`<data value='[[*myTV]]'>[[*description]]</data>`]]
TL;DR... The short version: Storing the entire output in the TV and extracting text from within that TV to output is much more difficult than storing individual components of that output in separate TVs and bringing them together for output when needed.
The longer version: In any situation where you're storing both data and HTML in a TV (which is not advisable in the vast majority of cases), you'll likely find duplication of your data across your project, and if by chance you decide to change the html at some point in the future, you then have to go into each and every TV field and change that HTML, which is the opposite effect from what a CMS is supposed to do - i.e. make Content Management easier!
If you do happen to find a use case for storing TVs along with their HTML formatting, that is a job best left for MODX Chunks, where you can code the implementation of your TVs within HTML in one spot within MODX and instead of duplicating that code everywhere, you reference the chunk like so: [[$chunk]].

How to Create a Spotify Playlist from a File

I have a text file I created using fb2k text tools; Artist Name - Song Name \n(new line)
This file includes my full music library, including 85k songs.
I'd like to somehow convert this to a single or multiple Spotify Playlists.
playlist-converter.net is doing one song per second, which means it is going to take roughly 24 hours to create this playlist on that site.
Is there any way i can do this locally using some github script or maybe a site that allows you to upload a file which will convert fairly quickly?
Thanks in advance
I dont know if exists a ready-to-use script for this, but you can do it yourself, its not that hard if you know some programming language.
You can use Spotify API
https://developer.spotify.com/
For each line, you will have to call API with the name of song and Artist
https://developer.spotify.com/web-api/search-item/
So will return an JSON object, with the id of song.
For each id you will have to call api again, to include the new song
https://developer.spotify.com/web-api/add-tracks-to-playlist/
Thats it, good luck !

What is the pattern for Instagram photo URLs?

When uploading a photo to Instagram, a unique URL is generated (e.g. https://instagram.com/p/0_Cy2pkW0k/ or https://instagram.com/p/zIhovthQQP/). I've noticed that
the strings at the end of the URL are more or less sequential (though they seem to loop back every few months),
not every string has a photo associated to it (e.g. https://instagram.com/p/zIhovthQQO/ and https://instagram.com/p/zIhovthQQQ/ link to nothing)
and the strings consist of upper- and lower-case letters, numbers and the underscore character.
If I knew the timestamp of a photo and its uploader, would it be possible for me to know the URL string as well? Ideally, my goal would be to know that if I uploaded a photo at a certain time, I could know in advance what its URL would be.
More generally, if I had a large database of strings, how would I go about in trying to reverse engineer the way the strings are generated?

how to play track from certain position using spotify apps API

I am developing spotify third party application using javascript API.
I am trying to play the track from certain position.
I am having following code,
player.position = 50000;
player.play(track);
But this code plays track from begining.
I want to play the track from certain position.
Is there any way to play track from certain position?
Thanks.
You need to play the track first, then as soon as playback starts seek to the location you want.
You can observe when playback starts by adding an observer for models.EVENT.CHANGE to the player object and looking at the playing property.
You can also link directly to a specific position in a track by adding #1:31 to the end of a URI, for example spotify:track:3iDK8BAaBUatPR84gdfa9g#0:15.

Resources