Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write upgrading guide for v1.0.0 #646

Merged
merged 4 commits into from
Oct 18, 2023
Merged

Conversation

FelonEkonom
Copy link
Member

This guide is mostly made of pieces of upgrading guides for v1.0.0-rc0 and v1.0.0-rc1

@FelonEkonom FelonEkonom added the no-changelog This label has to be added if changes from the PR are not meant to be placed in the CHANGELOG.md label Oct 16, 2023
@FelonEkonom FelonEkonom requested a review from mat-hek as a code owner October 16, 2023 14:24
@FelonEkonom FelonEkonom force-pushed the v1.0.0-upgrading-guide branch from f70b2e0 to b205a81 Compare October 16, 2023 14:26
guides/upgrading/v1.0.0.md Outdated Show resolved Hide resolved
Comment on lines 19 to 46
There is no more `:playback` action available, as the pipeline will start playing automatically once its setup is completed.
If you need to start the pipeline as soon as possible, simply do not return the `:playback` action in `c:Membrane.Pipeline.handle_init/2` or `c:Membrane.Pipeline.handle_setup/2` callbacks:
```diff
@impl true
def handle_setup(_ctx, state) do
...
- {[playback: :playing], state}
+ {[], state}
end
```
In case you need to defer the moment the pipeline starts playing, and for this purpose you have returned `:playback` action in some other callback than `handle_init` or `handle_setup`, now you need to do two things - first, mark the setup as incomplete with `t:Membrane.Pipeline.Action.setup/0` action returned from `handle_setup`, to prevent it from automatically changing the playback to `:playing`:

```diff
+ @impl true
+ def handle_setup(_ctx, state) do
+ {[setup: :incomplete], state}
+ end
```

Then, you need to return `setup: :complete` instead of `playback: :playing` action in a callback after which completion you want your pipeline to start playing:
```diff
@impl true
def handle_info(:now_start_playing, _ctx, state) do
...
- {[playback: playing], state}
+ {[setup: :complete], state}
end
```
Copy link
Member

Choose a reason for hiding this comment

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

I guess this was already introduced in 0.12 🤔 https://hexdocs.pm/membrane_core/0.12.9/v0-12.html#remove-playback-action

@FelonEkonom FelonEkonom requested a review from mat-hek October 17, 2023 12:46
@FelonEkonom FelonEkonom merged commit d0680e9 into master Oct 18, 2023
1 check passed
@FelonEkonom FelonEkonom deleted the v1.0.0-upgrading-guide branch October 18, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog This label has to be added if changes from the PR are not meant to be placed in the CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants