I know it is somehow possible to implement a windows media player in a form with Visual C#.
The info for that is here: How to add the libraries and here How to code it.
But my project is in Visual C++ and I'm having a hard time finding how to do the same. It is a windows store application based on an example from a Hearth Rate Bluetooth monitor.
My goal is to play a video while the data acquisition occurs.
The answer is Windows Store App can't handle ActiveX controls. At least in a straightforward way.
The solution was to implement a MediaElement from the Toolbox into the XAML page. That element is easy to use with mediaElement.Play() and mediaElement.SetSource()
Related
I'm developing a Windows 10 Universal app (UWP).
Is it possible to set application as TopMost (always on top)? Like WPF or Winforms (TopMost property).
Thanks
A feature called CompactOverlay mode was added in the Creators Update that supports this type of functionality. When an app window enters compact overlay mode it’ll be shown above other windows so it won’t get blocked. This allows users to continue to keep an eye on your app's content even when they are working with something else. The canonical example of an app taking advantage of this feature is a media player or a video chat app.
A blog post describing the feature can be found here
https://blogs.msdn.microsoft.com/universal-windows-app-model/2017/02/11/compactoverlay-mode-aka-picture-in-picture/
Short answer is no, there is no way as of today to make the application modal.
There is a petition going around asking for this functionality, which was requested last December but given the amount of votes it got (35 at the time this answer was written), it doesn't look like it will be taken into consideration anytime soon.
As mentioned in the comments, this functionality would be PC only so even if it was added, my assumption would be that it wouldn't work outside of the PC mode (so no tablet, mobile or surface family device support).
It's not possible UWP apps have some restrictions compared with WPF of Win32 apps(classic apps).
With uwp apps you need enable some capabilities to do something special in your app as you can see in the link uwp apps need ask for permission or they can't access or modify files directly.
https://msdn.microsoft.com/en-us/library/windows/apps/mt270968.aspx
Best Regards
Im trying to develop an app for Windows 10 which I hope to submit to the store. I want to get access to the Taskbar APIs so I can set the progress level (green bar behind the process text).
In Windows 7 I used the some of these APIs:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd391692(v=vs.85).aspx
They were wrapped by this handy library which I used in my C# app:
http://blogs.microsoft.co.il/sasha/2009/02/12/windows-7-taskbar-apis/
I cant find the equvilant for UWA Desktop Extension, Any ideas?
Mike
Basically the images are comes from the app asserts, see this: Guidelines for app assets Target-based assets session for more information. The asserts are the read-only stuff and we cannot programmatically change from the code, which means we cannot create the animation on taskbar.
The APIs like ITaskbarList3 are not available in Windows Universal App.
Basically base on my understanding, Microsoft wants to use push notification/live tile also badge to deliver the current state like current progress.
I'm making a C# windows application, in which I've embedded a Windows Media Player in my form.
Now, instead of using the player in a normal way, I want to access its buttons, for e.g I want to hide its "Play" & "Pause" button.
In short, I want to customize the player according to my needs.
How can I do so?
You will have to hook the creation of the app. Mainly the windows mesaage WM Create or WM Paint.
There You have to check which window names the corresponding controls have. There are several tools to examine such things during runtime, which all use the windows hooking mechanism. However, I think this will fail for metro apps. You must read about hooks . Check codeproject.com for that, because You also will need to create at least one dll. And there is a good example in c, which surely can be ported to c#.Can I give You furthrer info?
I'm trying to implement camera security in my application. I got some SDK's from some security companys to implement there system but they all use ActiveX. My view right now is that ActiveX is kinda old?
But what is the newest way to get video from devices and display (stream) them on a screen?
What control to use in .net 4.5 WPF (and Windows 8)
I'm working on video WPF app for two years now and we had a fundamental problem with video and WPF which was never resolved, and that's variable fps-rate. This blog post goes into details.
There's also a nice library called Media Kit (by Jeremiah Morrill), it might be suitable for your problem.
In our solution we had no choice but to expose HWND's for our rendering DirectX engine. We accomplished this by using HwndHost class and extending it to our custom WPF control. Note this is the base class for windows forms host, so you get the same amount of problems as with WinForms-WPF inter op.
Also, ActiveX is the only way to display professional camera video streams in web interfaces, it's still a defacto industry standard, you'll get it from MOXA, Acti, Vivotek and various other camera equipment manufactureres.
One more thing, if you need to perform some advanced analysis of video, I'd suggest OpenCV.
I want to play an AVI video in my WInForm. I'm not worried about Codec(s). We'll install them on the client with a group policy.
The video plays great in Windows Media player but having to tell people to "Click Start, My Computer, Network Share, Sub-Folder, etc" is complicated over the phone. The idea is to make a C# App that plays the video within the app.
(For those who argue, why not put shortcuts on the desktop)
We can do that but people delete shortcuts or their desktop is way too cluttered. So I want to make a quick app that displays the list of video's (via ComboBox) and plays the selected video within the App. The video's path should be on the server instead of "bundling" the video inside the app.
Thanks
--- The question is what do I need to do to play the video (code, tutorial links, etc).
--- Based on Rajesh's code
I get the following error
Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
I am using Visual Studio 2010 with Windows 7 and the June 2010 Direct X SDK. I had to browse to the dll in the C:\Windows\Microsoft.Net\Managed Code for DirectX folder and search each subfolder for that class.
Using the Windows Media Player Control with Microsoft Visual Studio
Try the DirectX SDK from Microsoft for .Net
It contains a AudioVideoPlayback namespace with the Video class that is easy to use in any .Net project. You bind the Video class to a Panel control like this:
Video video;
public Form1(string[] args) {
InitializeComponent();
video = new Video(dialog.FileName);
video.Owner = panel1;
}
The video class contains several methods for playback like Play, Pause, Stop and of course FromFile.
More information on using the AudioVideoPlayback namespace in C# can be found at:
AudioVideoPlayback API
Video Class (Microsoft.DirectX.AudioVideoPlayback)
There's a good .NET wrapper for directshow, you can use it: http://directshownet.sourceforge.net/
Another alternative, that can make the retrieval of videos out of the net easy is use the WebBrowser control, and then incorporate a flash/html5 video player within.