Closed bes closed 5 years ago
One way to solve my issue is to patch PlaylistTag.swift
like so:
public init(tagDescriptor: PlaylistTagDescriptor,
tagData: MambaStringRef,
- tagName: MambaStringRef,
+ tagName: MambaStringRef?,
parsedValues: PlaylistTagDictionary? = nil,
duration: CMTime = CMTime.invalid) {
self.tagDescriptor = tagDescriptor
self.tagData = tagData
self.parsedValues = parsedValues
self.tagName = tagName
self.duration = duration
}
But there might be a better way to solve it generically.
If I wasn't so bad at reading I would have noticed this initializer
/**
Initializer for creating `PlaylistTag`s while parsing HLS. Specialized for tags that do not have tag
names (i.e. PantosTag.Comment and PantosTag.Location)
- parameter tagDescriptor: An PlaylistTagDescriptor.
- parameter tagData: The tag data as a `MambaStringRef`.
*/
public init(tagDescriptor: PlaylistTagDescriptor,
tagData: MambaStringRef) {
self.tagDescriptor = tagDescriptor
self.tagData = tagData
self.tagName = nil
self.duration = CMTime.invalid
}
Which is obviously everything I need facepalm
Yeah, constructing tags is a little difficult for the special case tags. Glad you figured it out.
I am trying to rewrite a playlist, specifically change the
Location
But when I do this i get something like this as output
When I compare the incoming
tag
and mymutableTag
, I can see some differences that don't seem to be exposed by the API.For example,
tagName
isnil
in the incomingtag
, but it's not possible to set it tonil
using the exposed API AFAICT.The reason I am creating a new tag is because
tagData
is immutable.Expected Behavior
To be able to set a
PantosTag.Location
while doing.transform
. APlaylistTag
withPantosTag.Location
should be written as the string intagData
, without any decoration.Observed Behavior
It's not possible to set a correct
PantosTag.Location
during.transform
. ThePlaylistTag
is decorated with#Location:...
when writing it.Reproduction Steps
#Location
rows, which are not valid HLS.Observed on device(s):
Observed on OS Version(s):
Thanks for all the good work! I hope I am just doing something silly and this can/should be done in a completely different way.