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

Handling Stream Frames #10

Open
shayaanahmed opened this issue Feb 19, 2019 · 1 comment
Open

Handling Stream Frames #10

shayaanahmed opened this issue Feb 19, 2019 · 1 comment

Comments

@shayaanahmed
Copy link

shayaanahmed commented Feb 19, 2019

Kindly provide any demo to convert frames to video in Angular/HTML.
Below is my code in which I'm receiving FRAMES (as BLOB Object) and then convert it into BASE64 but its not working!

const socket = new WebSocket('ws://localhost:5000');

     socket.addEventListener('open', function (event) {
         socket.send('Connected to Websocket');
     });
    
    socket.addEventListener('message', function (event) {
      const reader = new FileReader();
      reader.onload = function () {
        const dataUrl: any = reader.result;
        const base64 = dataUrl.split(',')[1];
        $("#image").attr("src", "data:image/png;base64," + base64);
      };
      reader.readAsDataURL(event.data); 
    });

@lexgp
Copy link

lexgp commented Mar 3, 2019

it video, no images
but i dont run successful too)

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

2 participants