Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Yaron last won the day on November 7 2020

Yaron had the most liked content!

Community Reputation

52 Excellent

1 Follower

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I think this issue has to do with the integrated debugger an some form of optimization microsoft changed in Windows 10. More info from Marco. If I disable the integrated debugger then running from inside Delphi works at the same speed as if I run it externally, so I don't think that having D7 installed under the program files folder is the cause of this issue. I tried setting "delphi32.exe" in Win7 compatibility mode, but it didn't help. I even tried running externally and then connecting the debugger, but as soon as new DLLs are loaded (playing a media file using directshow), everything is the same slowness. My problem running in a VM is that I'm developing a media player and as such, it uses a lot of hardware acceleration features and running under a VM will be a headache. And a media player needs internet access for streaming and opening a Win7 machine to the internet is a bit dangerous nowadays when security patches are no longer released. Any other ideas?
  2. Yaron

    WebView2 synchronious calls

    @FPiette My application has over 100 keyboard macros, many dynamically created UI elements (skinned buttons) and even a TCP/IP control API (used for remote control) that can trigger events that should not be activated while a new media is in the process of loading, I can't simply disable one button, I have to disable 100's of elements and several event triggers that may execute unwanted functionality while waiting for the javascript callback event to trigger. Sure, I can do that, but it would take a lot more work than just having WebView2 return a result synchronously like TWebBrowser is able to do. @Edwin Yip I considered CEF4Delphi, but from my initial investigation, there were several show-stoppers, including the possible illegality of including audio/video codecs required by YouTube in the compiled binary, something I'm not willing to do. With regards to the 120+ MB WebView2 download, it won't be a thing in Windows 11 as WebView2 comes pre-installed on Win11. For Win10, I offer my users a quick setup option to download and install the evergreen version of WebView2 without much hassle.
  3. Yaron

    WebView2 synchronious calls

    I'm not sure how event driven would help me here, I have to wait until specific data is returned from a javascript function before allowing the code to proceed. Here's a real life example: 1. A user presses "play" in my app to play content. 2. I execute a javascript function to return data on the content (e.g. duration in seconds). 3. I now need to display the a position bar on a timeline to the user, which uses a combination of duration and the current position (which isn't always "0" when starting playback of live feeds). As soon as the user presses "play", I want to block all UI interaction until I get my data back from the javascript function. Sure, I can artificially block UI interaction by disabling every UI entry point, but that would be a messy workaround when all I need is the javascript function to return the result synchronously.
  4. Yaron

    WebView2 synchronious calls

    I am using the microsoft's WebView2 API to embed the chromium based edge browser inside my Delphi 7 application (using Winsoft's WebView2 wrapper component). My problem is that WebView2's ExecuteScript function returns results asynchronously through a call-back function, which is a problem because my app needs to setup a few things based on the javascript function's result and can't proceed until the data is available. I couldn't find any way in Delphi to process the results synchronously without calling "Application.ProcessMessages" in a loop until the result function is triggered (I can't use "Sleep" because then the result function will never be triggered). Of course calling "Application.ProcessMessages" in a loop is not very desirable, so I'm wondering if there's a better approach?
  5. Sorry if I wasn't clear, I was referring to DirectShow which does not use a browser component. It does use http transport and you can specify the user-agent, but it makes no difference, somehow YouTube identifies it and limits the bandwidth to unusable levels.
  6. From what I can tell, the problem is that YouTube is now detecting non-valid clients and then putting a bandwidth limiter on the connection, making playback unpractical. At least that's I experience when trying to use the D3YD YouTube Directshow filter. I am experimenting with it now, I can get it to load the video, but I'm still not sure how to capture javascript event and send the event's data back to Delphi.
  7. If you mean using DirectShow, there was a filter for that, but it's no longer functioning correctly after youtube changed something server-side and the developer is no longer responsive.
  8. @Fr0sT.Brutal It's the H.264 codec and AAC audio, it's sort of gray legally, but I'd rather avoid any such hassle. @FPiette Probably around $200. It's basically a wrap-up job with minimal logic (I'm doing the YouTube/javascript code, I just need access to the component/events and bridge to javascript commands/events.
  9. This is a tough one, I need advice. I currently offer the option to play YouTube video content in my Delphi 7 app by using YouTube's IFRAME player and Javascript API inside a TWebBrowser component. Unfortunately, the TWebBrowser component is limited to the Edge Legacy engine (Edge v11) and is dropping frames like crazy, which is why I would like to move the code to use the Edge Chromium engine. Previously, Microsoft let you choose the engine by specifying a registry key (HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION), but it seems that with the Chromium version, they dumped the old IWebBrowser interface for a new WebView2 interface. Unfortunately, I haven't found any WebView2 support for Delphi 7. It seems WebView2 support was only introduced in Delphi 10.4 and I only own Delphi 10.3 and can't afford paying $1000+ just for this feature. I'm aware of Delphi Chromium Embeded 3 project, but it may have legal issues with the decoders required to play YouTube content, so it's not an option. So the questions are: Can I hire someone to write a DLL I can then use in Delphi 7, giving me the functionality I need (video position within my window handle and a Javascript bridge to the YouTube API data/events)? Is there a WebView2 implementation that I missed and is compatible with Delphi 7 or at least would allow me to generate a DLL I can use in Delphi 7, but write in Delphi 10.3? Is there an option I haven't considered?
  10. @Kas Ob.I wasn't intending for my app to do the mixing, windows does it itself automatically as long as the audio device is not locked exclusively. I'm not sure if your solution is per-application or affects the entire system. I guess I have to do some more research.
  11. @Kas Ob. Passing a volume level greater than 100 does digital amplification? If that's the case then it's a non-issue as I don't plan on allowing greater than 100 volume.
  12. @Kas Ob. Thank you, I really appreciate your effort and time, I will try it out shortly. How does the rare mixer timing bug manifest itself, what should I be looking for?
  13. @Kas Ob. There are currently 5 events that trigger a different .wav file playback, might be extended to 9 in the future. With regards to output devices, I mean on my PC I have speakers and a TV set, with DirectShow I can control whether the audio is played through the speakers or through the TV set.
  14. @Kas Ob. VCP looks like a massive library, I looked at the waveplayer demo and it doesn't seem to support output device selection. If you have experience with VCP, can you give me a few pointers, my goal is play .wav files asynchronously in the background as the user is traversing the menu. I currently use this function structure "PlaySound(sAudio : WideString; sDevice : String; iVolumeLevel : Integer);" Where sAudio is the ".wav" filename, sDevice is the audio device name and iVolumeLevel is a volume value from 0 - 100.
  15. @Vincent Parrett I'm using the latest version of FastMM