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

feat: support media, html sources and websocket #20

Closed
wants to merge 10 commits into from

Conversation

birme
Copy link
Contributor

@birme birme commented Sep 25, 2024

Added features:

  • can specify multiview layout when doing production-config
  • display thumbnail on card and fix cache issue
  • add management lock
  • support media and html sources in prod and web sockets

Saelmala and others added 7 commits September 23, 2024 16:35
Bumps [find-my-way](https://github.com/delvedor/find-my-way) to 8.2.2 and updates ancestor dependency [fastify](https://github.com/fastify/fastify). These dependencies need to be updated together.


Updates `find-my-way` from 7.6.2 to 8.2.2
- [Release notes](https://github.com/delvedor/find-my-way/releases)
- [Commits](delvedor/find-my-way@v7.6.2...v8.2.2)

Updates `fastify` from 4.17.0 to 4.28.1
- [Release notes](https://github.com/fastify/fastify/releases)
- [Commits](fastify/fastify@4.17.0...v4.28.1)

---
updated-dependencies:
- dependency-name: find-my-way
  dependency-type: indirect
- dependency-name: fastify
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [semver](https://github.com/npm/node-semver) to 7.5.4 and updates ancestor dependency [nodemon](https://github.com/remy/nodemon). These dependencies need to be updated together.


Updates `semver` from 7.0.0 to 7.5.4
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](npm/node-semver@v7.0.0...v7.5.4)

Updates `nodemon` from 2.0.22 to 3.1.7
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](remy/nodemon@v2.0.22...v3.1.7)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
- dependency-name: nodemon
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Copy link
Contributor

@permobergedge permobergedge left a comment

Choose a reason for hiding this comment

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

Some initial code comments.

In general, try to avoid reformatting existing code to much.

Comment on lines 8 to 12
// const send = ws.send.bind(ws);
// ws.send = (message) => {
// console.debug(`[websocket] sending message: ${message}`);
// send(message);
// };
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

Comment on lines 32 to 37
// TODO: When possible to edit layout, uncomment the following code
// const [modalOpen, setModalOpen] = useState(false);
// const toggleConfigModal = () => {
// setModalOpen((state) => !state);
// };

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

Comment on lines 176 to 202
// <>
// <button
// onClick={toggleConfigModal}
// title={t('preset.configure_layout')}
// className={`absolute top-0 right-[-10%] min-w-fit`}
// >
// <IconSettings className="text-p" />
// </button>
// {modalOpen && (
// <div className="absolute top-5 right-[-65%] flex flex-col">
// <button
// type="button"
// className={`min-w-fit bg-zinc-700 rounded-t-sm p-1 border-b-[1px] border-b-zinc-600 hover:bg-zinc-600`}
// onClick={() => openConfigModal('create')}
// >
// {t('preset.create_layout')}
// </button>
// <button
// type="button"
// className={`min-w-fit bg-zinc-700 rounded-b-sm p-1 hover:bg-zinc-600`}
// onClick={() => openConfigModal('edit')}
// >
// {t('preset.update_layout')}
// </button>
// </div>
// )}
// </>
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the comments

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

Comment on lines 107 to 129

const stream: PipelineStreamSettings = {
ingest_id: ingestUuid,
source_id: sourceId,
pipeline_id: pipeline.pipeline_id!,
input_slot: input_slot,
alignment_ms: pipeline.alignment_ms,
audio_format: pipeline.audio_format,
audio_sampling_frequency: pipeline.audio_sampling_frequency,
bit_depth: pipeline.bit_depth,
convert_color_range: pipeline.convert_color_range,
encoder: pipeline.encoder,
encoder_device: pipeline.encoder_device,
format: pipeline.format,
max_network_latency_ms: pipeline.max_network_latency_ms,
width: pipeline.width,
height: pipeline.height,
frame_rate_d: pipeline.frame_rate_d,
frame_rate_n: pipeline.frame_rate_n,
format: pipeline.format,
encoder: pipeline.encoder,
encoder_device: pipeline.encoder_device,
gop_length: pipeline.gop_length,
height: pipeline.height,
max_network_latency_ms: pipeline.max_network_latency_ms,
pic_mode: pipeline.pic_mode,
speed_quality_balance: pipeline.speed_quality_balance,
video_kilobit_rate: pipeline.video_kilobit_rate,
width: pipeline.width,
ingest_id: ingestUuid,
source_id: sourceId,
input_slot,
bit_depth: pipeline.bit_depth,
speed_quality_balance: pipeline.speed_quality_balance,
convert_color_range: pipeline.convert_color_range,
audio_sampling_frequency: pipeline.audio_sampling_frequency,
audio_format: pipeline.audio_format,
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid moving around the order of lines of code, is there a difference here? Can we revert this to old order (which I guess didn't make sense, but new order doesn't make it more clear either?)

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea was to move it around so that it matched the order in the PipelineStreamSettings type declaration, but I can change it back

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

@@ -20,7 +20,6 @@ export async function GET(
status: 403
});
}

Copy link
Contributor

Choose a reason for hiding this comment

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

it's better with a newline here

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

@@ -15,7 +15,6 @@ export async function POST(request: NextRequest): Promise<NextResponse> {
status: 403
});
}

Copy link
Contributor

Choose a reason for hiding this comment

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

it's better with a newline here

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

@@ -63,14 +64,17 @@ export const en = {
},
production_configuration: 'Production Configuration',
production: {
add_source: 'Add Source',
add_source: 'Add ingest',
Copy link
Contributor

Choose a reason for hiding this comment

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

We're not to sure about this rephrasing from source to ingest.. we'll need to come back to that

@@ -65,14 +66,17 @@ export const sv = {
},
production_configuration: 'Produktionskonfiguration',
production: {
add_source: 'Lägg till källa',
add_source: 'Lägg till ingång',
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above with rephrasing

pic_mode: 'pic_mode_ip'
{
_id: new ObjectId('65cb266c00fecda4a1faf977'),
name: '12 inputs HD',

Choose a reason for hiding this comment

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

Aren't there 13 inputs here?

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

ws.onopen = () => {
if (action === 'closeHtml') {
ws.send(`html close ${inputSlot}`);
ws.send('html reset');

Choose a reason for hiding this comment

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

Why is "reset" here? And 3 rows down. Doesn't look necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

},
closeHtml: (input: number) => {
ws.send(`html close ${input}`);
ws.send('html reset');

Choose a reason for hiding this comment

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

reset not necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

},
closeMediaplayer: (input: number) => {
ws.send(`media close ${input}`);
ws.send('media reset');

Choose a reason for hiding this comment

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

reset not necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

resolved

@Saelmala Saelmala deleted the feat-inc-2 branch November 5, 2024 08:29
permobergedge pushed a commit that referenced this pull request Jan 22, 2025
* feat: add management lock

* fix: remove left-over file, has been renamed

* Feat/thumbnail fetch (#14)

* feat: add additional filtering

* fix: handle active + source filter, reduce code

* fix: allow multiple source type selection

* fix: linting

* fixup!

* feat: sorting ui

* fix: add ingest type to database

* feat: add sort based on lastConnected

* fix: remove duplicate handleSorting call

* fixup!

* fix: add date to source card

* fixup!

* fix: add status-not-gone check

* fix: linting error

* fix: remove unused function

* feat: updated to add additional multiviewers in the production-output-modal

* feat: updated the functions on the production-page to handle a multiview-array

* fix: changed the interface to have multiview as array

* feat: updated to handle multiview-array when fetching server and api

* fix: updated to stream-handling, not comfortable with the structure of this part

* fix: updated to handle multiview-arr

* feat: not possible to add output to same port, will cause visible error

* fix: changed find to filter and maped through the results

* fix: removed dev-logs

* fix: correct filtering

* fix: lint test fail

* fix: changed to a some-check instead of a map

* fix: multiview-arr does individual fetch for all mvs and creates unique ids for each

* fix: updated ts-error

* fix: adding and removing source from active production is working again

* fix: added duplicate-check whenever multiviews-arr update and minor fixes

* fix: updated multiview-arr-interface to be called multiviews instead of multiview, and minor fixes

* fix: bug solve for incorrect gone assignment

* fix: some cleanups

* style: redesign SourceListItem Thumbnails

* feat: imageComponent and sourceListing cleanup

* feat: editView always shows same image as listing thumbnail

* feat: general sourceList component and GlobalContext

* fix: bad main merge

* fix: lint

* chore: add refresh images to translate and make modal z-index 50

* fix: use translate for refresh thumbnails and delete duplicated code from merge

* fix: remove another duplicated line

---------

Co-authored-by: Saelmala <[email protected]>
Co-authored-by: malmen237 <[email protected]>
Co-authored-by: Linda Malm <[email protected]>

* feat: add management lock

* fix: use global context instead of state

* fix: remove duplicates

* Feat/thumbnail fetch (#14)

* feat: add additional filtering

* fix: handle active + source filter, reduce code

* fix: allow multiple source type selection

* fix: linting

* fixup!

* feat: sorting ui

* fix: add ingest type to database

* feat: add sort based on lastConnected

* fix: remove duplicate handleSorting call

* fixup!

* fix: add date to source card

* fixup!

* fix: add status-not-gone check

* fix: linting error

* fix: remove unused function

* feat: updated to add additional multiviewers in the production-output-modal

* feat: updated the functions on the production-page to handle a multiview-array

* fix: changed the interface to have multiview as array

* feat: updated to handle multiview-array when fetching server and api

* fix: updated to stream-handling, not comfortable with the structure of this part

* fix: updated to handle multiview-arr

* feat: not possible to add output to same port, will cause visible error

* fix: changed find to filter and maped through the results

* fix: removed dev-logs

* fix: correct filtering

* fix: lint test fail

* fix: changed to a some-check instead of a map

* fix: multiview-arr does individual fetch for all mvs and creates unique ids for each

* fix: updated ts-error

* fix: adding and removing source from active production is working again

* fix: added duplicate-check whenever multiviews-arr update and minor fixes

* fix: updated multiview-arr-interface to be called multiviews instead of multiview, and minor fixes

* fix: bug solve for incorrect gone assignment

* fix: some cleanups

* style: redesign SourceListItem Thumbnails

* feat: imageComponent and sourceListing cleanup

* feat: editView always shows same image as listing thumbnail

* feat: general sourceList component and GlobalContext

* fix: bad main merge

* fix: lint

* chore: add refresh images to translate and make modal z-index 50

* fix: use translate for refresh thumbnails and delete duplicated code from merge

* fix: remove another duplicated line

---------

Co-authored-by: Saelmala <[email protected]>
Co-authored-by: malmen237 <[email protected]>
Co-authored-by: Linda Malm <[email protected]>

* fix: errors after conflict solving

* fix: build error

* fix: remove leftover file, unused import

* fix: update lock

* Feat/specify multiview layout when doing production-config(#16)

* feat: added another mv-preset and updated code to be arr instead of single-object

* feat: added optional style to be added to the options-dropdown

* feat: first draft of a multiview-layout setting

* feat: possible to create new layouts as multiview-previews and add it to productions

* feat: added feedback-streams to input-choice for multiviewer-layout

* fix: removed unnecessary undefined

* fix: when added a new layout it will be chosen in output-form on save

* feat: preview and program is now selectable and restructured the way options handle value

* feat: separated db-preset into db-preset and db-layout - 'multiview-preset' and 'multiviews'

* fix: a folder had accidentily been made as a file

* feat: resolved the remaining issues, so preset is turned into a layout and saved in production

* fix: resolved rebase-conflicts

* fix: updates due to feedback and some label-fixes

---------

Co-authored-by: Saelmala <[email protected]>
Co-authored-by: Lucas Maupin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants