Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I have code play video but it support only video from web host
C#
wbViewer.NavigateToString(@"<!DOCTYPE html>
                <html>
                <head>
                    <meta http-equiv='Content-Type' content='text/html; charset=unicode' />
                    <meta http-equiv='X-UA-Compatible' content='IE=10' /> 
                    <title></title>
                </head>
                <body>
                    <div>
                         <video autoplay loop preload='metadata' >
                            <source src='http://img-9gag-ftw.9cache.com/photo/a8bR9MZ_460sv.mp4' type='video/mp4' />
                                not support
                        </video>
                    </div>
                </body>
                </html>");

how can i play video from local
i change src='file://d:/smoke.mp4' but not work.
Posted
Comments
Sergey Alexandrovich Kryukov 19-Jan-15 23:59pm    
Don't to such things. How can it possibly work?
—SA

1 solution

I understand what is "local", don't understand what is "not in host". I recently demonstrated a simple example where, among other things, video is played from the file in the output (or executable) directory:
Methods or frameworks for compositing/blending videos in C# .Net WinForms/WPF[^].

(I hardly can imagine that anyone really need to hard-code any video file in XAML; you can bind it with some other control where the file name is put, or directly take the file name from an OpenFileDialog, but just a file name in Source attribute does work. Your URI will work as "d:/smoke.mp4", but better don't do it (it will make you a non-working application which cannot be copied to work on other computers), use relative URI. Or, if this is a permanent file, pack it embedded resource and use URI, use resource URI. :-))

—SA
 
Share this answer
 
v2
Comments
son0nline 19-Jan-15 23:34pm    
sorry about my english!
I want create a simple tool to view short video which download from 9gag
Sergey Alexandrovich Kryukov 20-Jan-15 0:00am    
I explained everything you need. If you still have a problem, ask a question.
—SA
son0nline 20-Jan-15 0:02am    
thanks you! I will use media element.
Sergey Alexandrovich Kryukov 20-Jan-15 0:08am    
All right.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900