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

Add Streaming Switch Button for Additional Options #188

Merged
merged 4 commits into from
Aug 4, 2024

Conversation

untari
Copy link
Contributor

@untari untari commented Aug 1, 2024

This PR closes/references issue: (#170)
This update introduces a switch button to toggle between standard and no-cookies YouTube URLs within the app.
Screenshot from 2024-08-01 16-06-17

Summary by Sourcery

This pull request adds a switch button in the admin room types edit view to toggle between standard and no-cookies YouTube URLs. The YouTube URL construction logic has been updated to respect the state of this switch.

  • New Features:
    • Introduced a switch button to toggle between standard and no-cookies YouTube URLs in the admin room types edit view.
  • Enhancements:
    • Updated the YouTube URL construction logic to dynamically switch between 'youtube.com' and 'youtube-nocookie.com' based on the new switch button state.

Copy link

sourcery-ai bot commented Aug 1, 2024

Reviewer's Guide by Sourcery

This pull request adds a switch button to toggle between standard and no-cookies YouTube URLs within the app. The changes include adding a new switch button in the admin room types edit view, introducing a 'noCookies' data property, and updating the YouTube URL construction logic in the MediaSource component to respect the 'noCookies' setting.

File-Level Changes

Files Changes
webapp/src/views/admin/rooms/types-edit/stage.vue
webapp/src/components/MediaSource.vue
Introduced a switch button to toggle between standard and no-cookies YouTube URLs and updated the URL construction logic accordingly.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @untari - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using camelCase for the 'noCookies' variable to align with Vue.js naming conventions (e.g., 'noCookies' -> 'noCookies').
  • To reduce code duplication, consider extracting the YouTube URL generation logic into a separate method that can be used for both the main URL and language-specific URLs.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

webapp/src/views/admin/rooms/types-edit/stage.vue Outdated Show resolved Hide resolved
webapp/src/components/MediaSource.vue Outdated Show resolved Hide resolved
webapp/src/components/MediaSource.vue Outdated Show resolved Hide resolved
Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please implement it in a way that every option is separate, e.g.

  • Loop
  • Autostart
  • Mute
  • Modest branding
  • Hide controls
  • Hide titles and uploader info
  • Don`t show related info at the end

So organizers should be able to hide controls and use modest branding without the nocookie-domain as well and configure all kind of options independently.

@untari
Copy link
Contributor Author

untari commented Aug 1, 2024

noted @mariobehling

For the code changes suggestions above, I will test it locally first

Copy link
Member

@hongquan hongquan left a comment

Choose a reason for hiding this comment

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

When you are building URL, it is safer to use URLSearchParams and URL.
For example:

const params = new URLSearchParams()
if (loop) {
  params.append('loop', 1)
}
const baseUrl = 'https://youtube.com'
const url = params.size ? `${baseUrl}?${params}` : baseUrl

Not every character is allowed in an URL, those API will automatically escape illeagal characters.

@untari
Copy link
Contributor Author

untari commented Aug 2, 2024

@hongquan Thank you for the suggestion, will modify the URL using the URLSearchParams.

@untari untari reopened this Aug 4, 2024
@untari
Copy link
Contributor Author

untari commented Aug 4, 2024

A picture showing the toggle switches for embedded YouTube parameters.
Screenshot from 2024-08-04 23-19-42

@mariobehling mariobehling requested a review from hongquan August 4, 2024 15:37
@mariobehling mariobehling changed the title add no-ccokies switch button Add Streaming Switch Button for Additional Options Aug 4, 2024
@mariobehling mariobehling merged commit 298e557 into fossasia:development Aug 4, 2024
2 of 4 checks passed
@mariobehling
Copy link
Member

  1. Enabling "Autostart" results in the video starting from the beginning of the livestream instead of showing the video at the actual live time.
    Compare: https://video-dev.eventyay.com/rooms/77b6e3b4-2380-41a7-bb50-1732c998425d/
    Screenshot from 2024-08-05 00-35-58

  2. It also does not do what it is supposed to do: The stream does not start automatically. Is the reason that there is a conflict with the profile option? There is an option to start livestreams automatically, but it also does not work with actual livestreams (only works with recorded videos). Compare: https://wikimania-live.eventyay.com/preferences

Screenshot from 2024-08-05 00-39-48

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.

3 participants