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

Vanilla viewer from README does not work #418

Open
lockenj opened this issue Aug 9, 2024 · 2 comments
Open

Vanilla viewer from README does not work #418

lockenj opened this issue Aug 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@lockenj
Copy link

lockenj commented Aug 9, 2024

Version affected
1.6.1

Describe the bug
If I copy the vanilla viewer example into an index.html page and launch it using https://github.com/dolbyio-samples/rts-app-react-publisher-viewer/tree/main

To Reproduce
Steps to reproduce the behavior:

  1. Setup a stream usinn the publisher from https://github.com/dolbyio-samples/rts-app-react-publisher-viewer/tree/main
  2. Paste this into an index.html
 <html>

<head>
    <!-- Import the Millicast JS SDK -->
    <script src="https://cdn.jsdelivr.net/npm/@millicast/sdk@latest/dist/millicast.umd.js"></script>
</head>

<body>
    <video id="my-video" controls autoplay muted></video>

    <script type="module">
        // Get media element
        const video = document.getElementById('my-video')

        // Set the credentials for the streaming
        const yourStreamName = "myStreamName"
        const yourStreamAccountId = "bUumEV"

        // Define callback for generate new token
        const tokenGenerator = () => millicast.Director.getSubscriber({
            streamName: yourStreamName,
            streamAccountId: yourStreamAccountId
        })

        // Create a new instance
        const millicastView = new millicast.View(yourStreamName, tokenGenerator, video)

        // Start connection to publisher
        try {
            await millicastView.connect()
        } catch (e) {
            console.log('Connection failed, handle error', e)
        }
    </script>
</body>

</html>
  1. Launch the index.html page

Expected behavior
Expect to see the viewer auto connect. All it does is spin.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@lockenj lockenj added the bug Something isn't working label Aug 9, 2024
@lockenj
Copy link
Author

lockenj commented Aug 9, 2024

After further digging this does work with the vanilla publisher also located in the README.

I am trying to use the publisher from [rts-app-react-publisher-viewer](https://github.com/dolbyio-samples/rts-app-react-publisher-viewer/tree/main/apps/publisher)

to quickly publish a local MP4 and work through the viewer side first...

It appears there may be more to this than I thought. I will dig through the docs and report back.

@juanpiquerez
Copy link
Contributor

@lockenj
I was looking at what you are reporting, the problem you are having is that when using that publisher, it is publishing without having a main source (sourceId=null) this is unexpected for the viewer, it expects there to be a main source, so it is loading, as it cannot process what you send it.
Could you try publishing with a main source (sourceId=null) and let me know if this solves your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants