Skip to content

Conversation

@FelonEkonom
Copy link
Member

@FelonEkonom FelonEkonom commented Jul 3, 2025

@FelonEkonom FelonEkonom requested a review from varsill July 3, 2025 13:06
Copy link
Contributor

@varsill varsill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add some tests as well ;)

end

@impl true
def handle_call(:get_tracks_info, _from, state) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NIT] Perhaps let's add some comment saying that think function MUST be called before we "schedule" segment downloads as otherwise it might take quite long for it to complete (all the previously "scheduled" segments need to be downloaded first)

Comment on lines 33 to 34
variant_id = Client.get_variants(client) |> Enum.at(0) |> elem(0)
client = Client.choose_variant(client, variant_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to allow specifying the variant ;)

@FelonEkonom FelonEkonom requested a review from varsill July 10, 2025 12:45
mix.exs Outdated
Comment on lines 77 to 78
{:membrane_transcoder_plugin, path: "../membrane_transcoder_plugin", only: :test},
{:membrane_realtimer_plugin, "~> 0.10.1", only: :test},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remember to revoke the Hex dependency

)

pipeline = Testing.Pipeline.start_link_supervised!(spec: spec)
Process.sleep(10_000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the final run I would prefer to read the whole playlist rather than expect that within 10s we will download some part of the stream, but we can leave it for now so that we don't need to prepare shorter fixtures.

description: """
Amount of time of stream, that will be buffered by #{inspect(__MODULE__)}.
Defaults to 1 second.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it defaults to 10s ;)

Defaults to 1 second.
Due to implementation details, the amount of the buffered stream might
be slightly different than specyfied value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
be slightly different than specyfied value.
be slightly different than specified value.

{:noreply, state}
end

defp choose_variant(state) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to define variant_selection_policy() here, where there is an implementation of this function?

Copy link
Member Author

@FelonEkonom FelonEkonom Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have put it in HLS Source because it is a part of its public API and ClientGenServer is a private module

Comment on lines 47 to 49
# let's create Client and choose variant asnychronously
# beyond init/1, because it requires doing some HTTP requests
# so it can take some time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# let's create Client and choose variant asnychronously
# beyond init/1, because it requires doing some HTTP requests
# so it can take some time
# let's create Client and choose variant asynchronously
# beyond init/1, because it requires doing some HTTP requests
# so it can take some time

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have deleted this comment

# let's create Client and choose variant asnychronously
# beyond init/1, because it requires doing some HTTP requests
# so it can take some time
self() |> send(:setup)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's just the matter of making sure that the parent of the GenServer doesn't need to wait for these HTTP requests, you can return {:ok, state, {:continue, term()} from the init() callback

@FelonEkonom FelonEkonom requested a review from varsill July 15, 2025 13:54
Copy link
Contributor

@varsill varsill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@FelonEkonom FelonEkonom merged commit 46d3223 into master Jul 17, 2025
3 checks passed
@FelonEkonom FelonEkonom deleted the ex-hls-source branch July 17, 2025 11:59
@FelonEkonom FelonEkonom moved this to Done in Smackore Jul 17, 2025
@FelonEkonom FelonEkonom self-assigned this Jul 21, 2025
@FelonEkonom FelonEkonom changed the title ExHLS Source Create ExHLS Source Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Create Membrane HLS Source using ExHLS

3 participants