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

<audio> tag streaming #201

Closed
ArtskydJ opened this issue Dec 8, 2014 · 2 comments
Closed

<audio> tag streaming #201

ArtskydJ opened this issue Dec 8, 2014 · 2 comments

Comments

@ArtskydJ
Copy link
Contributor

@ArtskydJ ArtskydJ commented Dec 8, 2014

Like #144.

Is something like this supported?

If it is not yet, might it be in the future?

Somewhere in index.html

    <script src="/bundle.js"></script>
    <audio id="audioElement"></audio>

Turn this into bundle.js using browserify.

var WebTorrent = require('webtorrent')
var client = new WebTorrent()

client.download(magnet_uri, function (torrent) {
    var file = torrent.files[0] // Let's say the first file is an audio file...
    var audio = document.getElementById('audioElement') // Get audio element
    file.createReadStream().pipe(audio) // Stream the audio into the <audio> tag
})
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jan 16, 2015

This is fixed now, thanks to @mathiasvr! You can see it on https://instant.io.

@feross feross closed this Jan 16, 2015
@ArtskydJ

This comment has been minimized.

Copy link
Contributor Author

@ArtskydJ ArtskydJ commented Jan 16, 2015

Sweet; thanks to you both!

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.