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

Create player component video-moq #10

Closed
emilsas opened this issue Nov 28, 2024 · 6 comments
Closed

Create player component video-moq #10

emilsas opened this issue Nov 28, 2024 · 6 comments

Comments

@emilsas
Copy link

emilsas commented Nov 28, 2024

Following the idea of issue #4, to decouple the player from the web application and improve modularity, we can create a WebComponent for the player. This approach ensures the player is fully encapsulated, making it reusable across different web pages and projects without dependencies on the current application structure.

In my mind the WebComponent <video-moq></video-moq> should implement and follow same logic of the classic <video> tag, may be in a first iteration we can focus in implement the most important ones.

From a user perspective I would imagine using the component like this (insipred in hls.js):

Basic Usage

<script src="https://some/cool/cdn/moq-js.js"></script>
<html>
   <body>
      <video-moq id="video" autoplay muted controls src="https://url/to/moq/catalog"></video-moq>
   </body>
</html>

Advanced Usage

<script src="https://some/cool/cdn/moq-js.js"></script>
<html>
   <body>
      <div id="video" autoplay muted controls src="https://url/to/moq/catalog"></div>
      <script>
         var video = document.getElementById('video');
         var videoSrc = 'https://url/to/moq/catalog';
         var player = new MoqPlayer();
         player.load(videoSrc);
         player.attachMedia(video);
         // After that you will get full control to player change tracks, volume, etc.
      </script>
   </body>
</html>

List of attributes to implement

Taken from <video>: The Video Embed element.

  • src
  • width
  • height
  • controls
  • autoplay
  • muted
  • poster

Possible implementation

The new WebComponent <video-moq> will render the canvas element to display de video and in the future with #7 we can overlay the controls if the attribute is set. For this we can reuse the whole library implemented here to control the video itself, so importing the script of the player will result in having the <video-moq>component and MoqPlayer class for advaced usaged exported.

@englishm
Copy link
Owner

englishm commented Dec 3, 2024

I really like this idea. (See: #4 (comment)) Thanks for writing it up!

@santipuppoQualabs
Copy link
Contributor

Working on this btw!

santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 9, 2024
…is commit should be reverted before merging.
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 9, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 9, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 9, 2024
@santipuppoQualabs
Copy link
Contributor

Opened a draft PR here. Open for suggestions/corrections

santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 10, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 10, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 10, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 10, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 11, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 11, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 11, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 11, 2024
…them to dom if no attribute is present. Added mute attribute like in <video> tag
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 11, 2024
… namespace and fingerprint as attributes or have them included as query params in the src attribute
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 14, 2024
… present as an attirubte. Also renamed variables to #element
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 14, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 14, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 14, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 14, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 14, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 18, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 18, 2024
santipuppoQualabs added a commit to santipuppoQualabs/moq-js that referenced this issue Dec 18, 2024
@santipuppoQualabs
Copy link
Contributor

Opened the PR so we can merge what we have now and keep working from there (Anyone feel free to review). I see there are some new features to be merged which we should include in the web component. There is also some other work to be done listed in the PR which did not seem worth it to delay the merge for. I'll be writing up some new issues with these points

@nicolaslevy
Copy link
Collaborator

Note from our meeting: This can be the starting point for a samples page like the dash.js one

englishm added a commit that referenced this issue Jan 16, 2025
@nicolaslevy
Copy link
Collaborator

nicolaslevy commented Jan 23, 2025

Merged in #16

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

No branches or pull requests

4 participants