Have you read the Tutorials?
Yes
Have you read the FAQ and checked for duplicate open issues?
Yes
What version of Shaka Player are you using?
v3.0.2
Please ask your question
Looking to extract the codec the player is using at a given instance in time for telemetry event purposes. Is there a function or event that can help achieve this?
getStats() seemed to be useful at first glance but unfortunately contains no info about the current codec.shaka.Player.StreamingEvent, although for our purposes it would be counter intuitive to parse an event in order to fire off an other event.Stream object, however this contains a list of codecs not the current one being used.Any help would be greatly appreciated - please let me know if I'm overlooking anything.
We don't support codec switching, so the array will only contain one kind of codec. They may have different profiles, but they should have the same base codec. You should use player.getVariantTracks() to get the tracks, the codecs field will have the array of codecs. Unfortunately due to Period flattening, there is no way to determine which is being used.
Actually looking over our definitions, I don't know why the codecs field would be an array, it should be a string. In the Track definition, it will have two codecs (e.g. vp09,opus), for audio+video; but there is also the audioCodec/videoCodec fields.
Looking for a bit more clarification - One of the DASH features for example is multi-codec support (suppose I had a manifest with AVC and HEVC tracks). If I were to make a call on getVariantTracks() would the returned array have a single unique codec (i.e. AVC or HEVC) or would it still contain both?
Until we support codec switching (#1528), we filter out codecs that don't match the initial codec selected. We pick the initial codec based on browser support and on bandwidth; once we pick a codec, we filter out all other codecs so you'll only see choices for one.
@rdailey98 Does this answer all your questions? Can we close the issue?
Closing due to inactivity. If this is still an issue for you or if you have further questions, you can ask us to reopen or have the bot reopen it by including @shaka-bot reopen in a comment.