How to add flash video in C# WinForms application? - c#

I want to make an interactive trainer for a BIG program. Instead of just making video tutorials, I was thinking to make the videos in camtasia, and edit them with flash. After the videos are ready, I want to upload them to my server, and the C# application should load the flash videos from my server.
I found the solution of adding flash videos to C# with the axShockwaveFlash control.
I can load videos from youtube for example like:
axShockwaveFlash1.Movie = "https://www.youtube.com/v/N6O2ncUKvlg";
But if I have the flash videos to my server like http://mywebsite.com/intro.flv how can I load them ?
I guess I need to set them in a player or something like that.
Another idea would be to just make the videos in camtasia, and export them to "web" directly from camtasia. But still, don't know how to tell the control to load it.
I just want to make this, so that it will be a little harder to download the videos. I know they can be easily downloaded also in this way, but it's more safer than just uploading them to youtube.

Here is an extended article on how to load flash in a WinForms application
In short:
Add toolbox reference to COM Component Shockwave Flash Object (found in C:\Windows\System32\Macromed\Flash)
Add control Shockwave Flash Object to Form
Set property Movie: [control].Movie = "[path]\animation.swf";
Start movie: [control].Play();

Related

Embed Youtube video in winforms webbrowser

I am trying to embed YouTube video in C# winforms webbrowser using this code:
webBrowser_q.Navigate("https://www.youtube.com/embed/OsHFxQSOkNU?autoplay=1&controls=0&enablejsapi=1&iv_load_policy=3&rel=0&showinfo=0&showsearch=0&start=0&end=0");
Unfortunately I get only black window instead of the video.
What am I doing wrong?
EDIT: I don't want to use AS3 player, because I want to use YouTube IFrame API.
You can find your answer here:
C# webbrowser Ajax call
According to this answer: "WebBrowser control (both WPF and WinForms versions) behaves in many ways differently from the full IE. You may want to implement Feature Control to bring its behavior as close to IE as possible (particularly, FEATURE_BROWSER_EMULATION)."
You can see the code sample that is given there. I was able to play a youtube video while before I saw a black screen and javascript errors.

Is it possible to use an embbeded control in Excel to preview video feed from webcam using DirectShow?

There are a quite a few of sources to get a video stream from webcam into a picturebox embedded in a userform.
Preview a camera in DirectShow and capture a still image - in VB.net
How do i use attached webcams to take still image in my application
However, I am trying to do something a little neater, basically have a the preview of the video stream from webcam in a control that is embedded directly into the sheet rather than on a floating userform. I am not sure if this possible. I would very much appreciate any pointers.
(Answer from TnTinMn's comment - Posting as an answer to remove from 'Unanswered' queue)
If you can write a .Net WinForm UserControl to view your video stream, then you should be able to produce a ActiveX UserControl that you can utilize in Excel.
Get the Microsoft InteropForms Toolkit 2.1 .
Even though it was originally intended to allow .Net UC usage in VB6, it works fine to write UCs for use in Excel.
As a test, I just wrote one that used the Windows Media Player and it played the video fine as a UserControl on the worksheet.
Start VS as an Admin as it needs to be able to register the control.
I would say build a Form with TopMost = True
Then you can display your webcam video in this Form
and put it anywhere you want.

WPF/C# webbrowser youtube

I want to play youtube movie in my application by using webbrowser.
The problem is about autoplay movies.
I know i can use embeded, but on embeded version its impossible to navigate the website.
Is there any solution how to autoplay youtube movies?
You can use a specific control 'COM' to show a movie 'swf' in a form, called 'Shockwave Flash Object'
And Swf Url Movie:
http://www.youtube.com/v/[CODE VIDEO]&autoplay=1
Google have actually made available an API which allows you to do this kind of thing across all platforms, whether it be in a web or application interface. You can find the documentation for it here. But as a guide, here is what you can do....
All you have to do is replace parts of the URL, which can be done easily with string manipulation. I have specifed link a - which is the normal youtube link, and b - which is the API link which can play in full screen mode (or size of your frame or web browser) and many other features which you can command through the URL.
a - http://www.youtube.com/watch?v=DuLPSz_Hffw
b - http://youtube.googleapis.com/v/DuLPSz_Hffw?autoplay=1&showinfo=0&loop=1
Hope that helps!

Load Flash object in Java Web Browser

I was wondering if there was some way to be able to load Flash objects from a custom Java web-browser. I want to be able to view YouTube videos for example.
I have read this: Embedding Flash Component into Java App, but I am not sure how I would use this seeing as I do not have the Flash locally as a .swf. I do not know where it loads the Flash file from. Also, I would prefer the solution to not require buying a product.
I know for sure that this is do-able using C# and the WebBrowser class because that uses the Flash plugin for IE, I was just wondering if there was a way to do this with Java.

WPF Youtube app running on Windows 7

I'm building a WPF application that should be able to play Youtube videos. But there are some problems running the app on Windows 7.
When I follow the article by Sacha Barber it shows a pop-up saying "File download security warning" which isn't very nice, I don't want the user to have to click ok every time.
Then there's a second approach. Use the WebBrowser's NavigateToString property and enter there a full HTML code for a page that plays the Youtube video. Unfortunately, that doesn't work for me at all, all I see is a black space where the video should be.
Have you ever come across anything like this? Thanks a lot.
I wrote a simple YouTube video viewer in WPF, and went down the NavigateToString route and built up the web page source by hand, using the embed code provided by YouTube, and this worked a treat (other than the fact several of the videos on YouTube are marked as unable to embed, so you get a link to view on the full site instead). I created an attached property to avoid any code behind too.
What is the code you are using?

Categories

Resources