Asked by:
[Asp.net Web Pages] play file mp3, mp4

Question
-
User-12748997 posted
I want play file mp3, mp4 on Pages
And I use html5+js+jquery
+) if Files be located in project that play files is oke
+) else Files be located in folder my computer( E, D or Download...) is not run and Error :searchms.aspx:1491 Uncaught (in promise) DOMException: The element has no supported sources. (play.click(function (e) {
e.preventDefault();
song.play(); // this error
});Friday, January 12, 2018 4:14 AM
All replies
-
Friday, January 12, 2018 5:00 AM
-
User-12748997 posted
I try this way, But problem is
+) if File be located in folder in project is oke
+) else Files be located my computer( E, D or anything..) is not run and error above
Friday, January 12, 2018 5:05 AM -
User346117707 posted
What is your code ? how you are trying to access the video which is not belong to your project location ?
Friday, January 12, 2018 5:44 AM -
User-12748997 posted
Yes,I try access file mp3, mp4 is not belong my project, and run in pages
Sunday, January 14, 2018 12:04 PM -
User753101303 posted
Hi,
Most if not all browser won't allow a web page to use local files for safety reason. Try F12 Console and you likely have a message telling you it is denied.
Your best bet would to have those files on the web site.
Sunday, January 14, 2018 12:12 PM -
User-12748997 posted
Yes, I see this error
But error above is another error
Thank you so much.
Monday, January 15, 2018 12:45 AM -
User-12748997 posted
Hi,
I want search file(mp3, mp4) use time (that time is time file be created) and after run file in pages.
But if files belong project is use method File.GetCreationTime.. output is time default(this time is wrong).
If Files is not belong project , use method File.GetCreateTime... output is exactly.
SO, YOU HAVE SOLUTION FOR ME?
THANK YOU SO MUCH
Monday, January 15, 2018 2:46 AM -
User753101303 posted
And how do you publish the project to the server ? If using the file system, the creation date is preserved when doing the copy.
If you want to track playtime I would rather register when playback started rather than looking at when the file was created (can't playback start after the file is published/uploaded ?)
Monday, January 15, 2018 8:04 AM