ToddFrankson 3 Posted yesterday at 08:34 PM (edited) The title system ist ... Edited 11 hours ago by TBx Changes title. It was really insignificant. Share this post Link to post
Anders Melander 1862 Posted 23 hours ago There's the old TMediaPlayer but AFAIR it's a pain (but possible) to get to work with TStream. A better alternative would be to import the type library for the Windows Media Player ActiveX and use that. https://chapmanworld.com/windows-media-player-in-delphi/ Share this post Link to post
Der schöne Günther 323 Posted 23 hours ago Maybe just a TWebBrowser (preferably using the Edge/WebView2 engine) is an option? Share this post Link to post
Rollo62 543 Posted 13 hours ago 9 hours ago, Der schöne Günther said: Maybe just a TWebBrowser (preferably using the Edge/WebView2 engine) is an option? This is interesting blog https://blogs.embarcadero.com/execute-scripts-and-view-source-with-tedgebrowser/ Perhaps this might work for showing videos, but there is also the possibility that certain Codecs or Plugins were missing, like HLS (.m3u8) : var HTMLContent: string; begin HTMLContent := '<!DOCTYPE html>' + '<html>' + '<body>' + '<video width="640" height="480" controls>' + //either local file '<source src="file:///C:/Pfad/zum/Video.mp4" type="video/mp4">' + //or stream '<source src="https://example.com/stream.m3u8" type="application/x-mpegURL">' + 'Dein Browser unterstützt das Video-Tag nicht.' + '</video>' + '</body>' + '</html>'; EdgeBrowser1.NavigateToString(HTMLContent); end; For accessing local files, there could be the need to add AdditionalBrowserArgument flags https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/working-with-local-content?tabs=dotnetcsharp#loading-local-content-by-navigating-to-a-file-url https://docwiki.embarcadero.com/Libraries/Athens//de/Vcl.Edge.TCustomEdgeBrowser.AdditionalBrowserArguments Share this post Link to post
Lars Fosdal 1800 Posted 11 hours ago @ToddFrankson Pls change title of topic from "Does anyone know of...." to "Play a video from a stream". Descriptive topic titles help users with finding relevant posts. Share this post Link to post
Attila Kovacs 637 Posted 11 hours ago 4 minutes ago, Lars Fosdal said: Pls change title of topic from "Does anyone know of...." to "Play a video from a stream". ?!? How can you change the title? Share this post Link to post
ToddFrankson 3 Posted 7 hours ago 4 hours ago, Lars Fosdal said: @ToddFrankson Pls change title of topic from "Does anyone know of...." to "Play a video from a stream". Descriptive topic titles help users with finding relevant posts. I was attempting to lure people in with curiosity.... Share this post Link to post
ToddFrankson 3 Posted 5 hours ago 15 hours ago, Anders Melander said: There's the old TMediaPlayer but AFAIR it's a pain (but possible) to get to work with TStream. A better alternative would be to import the type library for the Windows Media Player ActiveX and use that. https://chapmanworld.com/windows-media-player-in-delphi/ Neither currently allows a stream outside of a server side video..... 5 hours ago, Rollo62 said: This is interesting blog https://blogs.embarcadero.com/execute-scripts-and-view-source-with-tedgebrowser/ Perhaps this might work for showing videos, but there is also the possibility that certain Codecs or Plugins were missing, like HLS (.m3u8) : var HTMLContent: string; begin HTMLContent := '<!DOCTYPE html>' + '<html>' + '<body>' + '<video width="640" height="480" controls>' + //either local file '<source src="file:///C:/Pfad/zum/Video.mp4" type="video/mp4">' + //or stream '<source src="https://example.com/stream.m3u8" type="application/x-mpegURL">' + 'Dein Browser unterstützt das Video-Tag nicht.' + '</video>' + '</body>' + '</html>'; EdgeBrowser1.NavigateToString(HTMLContent); end; For accessing local files, there could be the need to add AdditionalBrowserArgument flags https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/working-with-local-content?tabs=dotnetcsharp#loading-local-content-by-navigating-to-a-file-url https://docwiki.embarcadero.com/Libraries/Athens//de/Vcl.Edge.TCustomEdgeBrowser.AdditionalBrowserArguments I need the ability to do this locally, without any file. For example, the same way you can load an image from a stream. The videos are small and are stored as proprietary objects. They are extracted to a MemoryStream. To play them I currently have to write them to a file (Memorystream.savetofile) and then load them in a player (WindowsMediaPlayer.URL). I'm looking for something to cut out the write to file Share this post Link to post
Patrick PREMARTIN 90 Posted 5 hours ago Hi You can use FFmpeg (perhaps with http://www.delphiffmpeg.com/) or VLC (check https://github.com/HemulGM repositories) if you want. Boian Mitov has a video stream player in his components packs (https://mitov.com/products/videolab). Share this post Link to post
DelphiUdIT 205 Posted 3 hours ago You can try also with https://prog.olsztyn.pl/paslibvlc/ It has the ability to play stream audio and video, but you need VLC installed on system. Share this post Link to post
Anders Melander 1862 Posted 1 hour ago (edited) 4 hours ago, ToddFrankson said: Neither currently allows a stream outside of a server side video..... I have some code that I use in my resource editor to display video from a memory stream, so it's definitely possible. I just looked and it's about 500-600 lines of code and involves a custom I/O handler among other horrors. Here's a screenshot: And here's a video: Hmm. Never mind with the video. I can't figure out how to create a video this forum supports. Edited 1 hour ago by Anders Melander Share this post Link to post
ToddFrankson 3 Posted 4 minutes ago 55 minutes ago, Anders Melander said: I have some code that I use in my resource editor to display video from a memory stream, so it's definitely possible. I just looked and it's about 500-600 lines of code and involves a custom I/O handler among other horrors. Here's a screenshot: And here's a video: Hmm. Never mind with the video. I can't figure out how to create a video this forum supports. Do you have it available somewhere so I can at least take a look? Share this post Link to post