mediadevices icon indicating copy to clipboard operation
mediadevices copied to clipboard

Native Client using gio for Desktop ( and possibly Mobile)

Open joe-getcouragenow opened this issue 5 years ago • 6 comments

Its possible to build native desktop and mobile clients using gio and i think its a great opportunity.

It can also build wasm web clients. Tinygo is close but not yet. Run demo here: https://gioui.org/

  • type in editor
  • type where it says hint
  • click transform checkbox.

The work for multimedia is going on here: https://todo.sr.ht/~eliasnaur/gio/125

  • patches for video going in now.
  • See here: https://lists.sr.ht/~eliasnaur/gio-patches

Audio works now on desktop. https://github.com/dejadejade/giox cd /examples/player && go build -o player . ./player file_example_MP3_5MG.mp3

Canvas also works https://github.com/ajstarks/giocanvas cd play && go build -o play ./play

joe-getcouragenow avatar Jul 01 '20 11:07 joe-getcouragenow

@joe-getcouragenow Hey, this is awesome!! Mediadevices is currently WebRTC oriented. However, we're working on supporting non-webrtc cases, https://github.com/pion/mediadevices/blob/redesign/examples/simple/main.go.

I think the new API will be really clean!! And will be super powerful to be combined with GIO. I can imagine that people will be able to build a video/audio player and even video conferencing apps easily with this combination.

Just to give you a glimpse, I can imagine that it would be something like,

	s, err := mediadevices.GetUserMedia(mediadevices.MediaStreamConstraints{
		Video: func(p *prop.Media) {
			p.Width = 600
			p.Height = 400
		},
	})
	if err != nil {
		panic(err)
	}

	t := s.GetVideoTracks()[0]
	defer t.Stop()
	videoTrack := t.(*mediadevices.VideoTrack)

        videoReader := videoTrack.NewReader()
        for {
              frame, _ := videoReader.Read()
              // render this with gio
        }

lherman-cs avatar Jul 01 '20 12:07 lherman-cs

@lherman-cs thank you so much for responding to this.

Well we need this for WebRTC conferencing and just playing videos. We currently have no way to run ion webrtc outside a browser as Apple Webview blocks access to the web cam and mic on Desktop. See here: https://github.com/webview/webview/issues/368

So desperation being the mother of all invention, i looked at Gio again, and it has really grown up.

If you like i can try to get the your WebRTC and the Gio Multimedia code together as a PR.

joe-getcouragenow avatar Jul 01 '20 12:07 joe-getcouragenow

@joe-getcouragenow yes please, that would be awesome! Are you planning to make it as a library/example?

lherman-cs avatar Jul 01 '20 14:07 lherman-cs

@joe-getcouragenow yes please, that would be awesome! Are you planning to make it as a library/example?

Both.

The Texturebinding and Shader code patches have not been merged yet into main tip. Looks like they will be very soon, and then it should be possible to have a crack at it.

Latest Patches: https://lists.sr.ht/~eliasnaur/gio-patches/%3C159407480987.28969.4368210228585413349-0%40git.sr.ht%3E

Main tip: https://git.sr.ht/~eliasnaur/gio/tree

joe-getcouragenow avatar Jul 11 '20 23:07 joe-getcouragenow

https://github.com/gioui/gio

https://twitter.com/giouiorg/status/1338855232508362752

they now accept pr's over github so its much easier to work on now.

gedw99 avatar Dec 28 '20 10:12 gedw99

looks like someone attempted video and gio here: https://github.com/dejadejade/giox/blob/master/player/video.go

I am on mac , not windows, but will see if i can get any progress....

gedw99 avatar Jun 23 '21 08:06 gedw99