-
Playing Camtasia Video In Web Browser Control
Hey guys,
I have tried to play a Camtasia video inside a web browser control but it comes up with javascript needs to be enabled error on page. How can I work it or find a work around that? I'd like to have a listbox that contains the movies and they would play in the browser. I have a membership site that I'd like to have a player that authenticates the user before playing them but first things first, what is the best way to accomplish playing Camtasia videos inside a form?
-Chris
-
Re: Playing Camtasia Video In Web Browser Control
One question, how are Camtasia videos different from other videos?
Why can't you just add a Windows Media Player control to your form and play it there?
-
Re: Playing Camtasia Video In Web Browser Control
Well outside of the html page their played on it depends on how they're produced. It could be a flv or swf file or even mp4. So it depends on how it's been rendered.
-
Re: Playing Camtasia Video In Web Browser Control
Okay.
So;
1. If you want to show your video on a HTML page, just simply navigate the webbrowser to the HTML page and then let the page to the rest. As for what code the HTML page should have, I can't help you without seeing the Camtasia Video code but you can try <object> or the "unofficial" <embed> tag.
2. If you want to play the video directly through your application without webbrowser, you would need to check which format the video is. Swf needs flash player. As for the other formats, you could use VLC Control (you get this when installing VLC).
-
Re: Playing Camtasia Video In Web Browser Control
Yeah, I think VLC would play all formats. Can you give me some sample code example to look at for using the VLC player?
-
Re: Playing Camtasia Video In Web Browser Control
Well, start by adding the VLC control to your form (Right click your toolbox and Choose Items... Look around for VLC, it should be under COM).
The rest is pretty selfexplaining.
-
Re: Playing Camtasia Video In Web Browser Control
Thanks, will give it a go.
-
Re: Playing Camtasia Video In Web Browser Control
-
Re: Playing Camtasia Video In Web Browser Control
So far the code I've seen example of isn't working, here is what I'm seeing:
vb Code:
AxVLCPlugin21.playlist.add(OpenFileDialog1.FileName)
AxVLCPlugin21.playlist.play()
-
Re: Playing Camtasia Video In Web Browser Control
Okay. I'm just gonna open a new project...
Add the VLC Plugin to my toolbox...
xD Be patient, I'm currently running on a 512 MB RAM...
Try the BaseURL property,
VLC.BaseURL = "C:\Myvideo.avi"
-
Re: Playing Camtasia Video In Web Browser Control
I'm getting "VLC is not declared"
-
Re: Playing Camtasia Video In Web Browser Control
Well yeah, thats cuz your control is named
AxVLCPlugin21
I renamed my control to VLC since its much easier to write.
Alright, this code worked for me:
VLC.playlist.add("Male1.wmv", 0)
VLC.playlist.play()
Or as it may be to you xD
AxVLCPlugin21.playlist.add("Male1.wmv", 0)
AxVLCPlugin21.playlist.play()
-
Re: Playing Camtasia Video In Web Browser Control
Here is the error I'm getting:
Quote:
System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"
Source="MyProject"
StackTrace:
at MyProject.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at MyProject.My.MyProject.MyForms.get_Form1()
at MyProject.My.MyApplication.OnCreateMainForm() in C:\Users\Anonymous\AppData\Local\Temporary Projects\MyProject\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at MyProject.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Runtime.InteropServices.COMException
Message="Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"
Source="System.Windows.Forms"
ErrorCode=-2147221164
StackTrace:
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at MyProject.Form1.InitializeComponent() in C:\Users\Anonymous\AppData\Local\Temporary Projects\MyProject\Form1.Designer.vb:line 59
at MyProject.Form1..ctor()
InnerException:
-
Re: Playing Camtasia Video In Web Browser Control
Do you get that error from debugging?
-
Re: Playing Camtasia Video In Web Browser Control
I tried to run the project and got the message.
-
Re: Playing Camtasia Video In Web Browser Control
okay, try deleting the VLC Object and adding it again, I just created a project with a VLC object and played a video without problems...
-
Re: Playing Camtasia Video In Web Browser Control
I've tried it 3 times. Doesn't matter. I've got to be doing something wrong here?
I'm adding VideoLAN VLC ActiveX Plugin v1 and VideoLAN VLC ActiveX Plugin v2.
Tried both, not working for some reason.
-
Re: Playing Camtasia Video In Web Browser Control
ok, I think some corrupt code has destroyed the Form, that happens sometimes when using 3rd party plugins.
You can start a new project or delete the form itself which contains the VLC plugin and redo it, there must be something wrong in Form1.Desinger.vb
-
Re: Playing Camtasia Video In Web Browser Control
Yeah, I've tried it on different forms. I'm still looking into it though.
-
Re: Playing Camtasia Video In Web Browser Control
I can create a project and send it to you... hold on a sec
-
Re: Playing Camtasia Video In Web Browser Control
k...got to put my daughter to sleep...will check on this in a bit.
-
1 Attachment(s)
Re: Playing Camtasia Video In Web Browser Control
Alright! Sorry it took so long time but here you have it, a fully working VLC media player.
-
Re: Playing Camtasia Video In Web Browser Control
Still getting same error result. Thanks though for that.
-
Re: Playing Camtasia Video In Web Browser Control
Hmm.. I don't think this issue is related with VLC... it might be some hardware change affecting the system... As the long error says, there are missing classes ;S
Try on another PC and I'm sure it'll work ^.^
-
Re: Playing Camtasia Video In Web Browser Control
I'll have to wait until tomorrow or the day after Christmas...this is weird. Thanks though for your help so far...I appreciate it!
-Chris
-
Re: Playing Camtasia Video In Web Browser Control