Playing audio file from directory in ASP.NET - c#

I have Gridview when i click play it will play audio file it will get directory from database and play the audio by opening windows media player it working fine in visual studio i am using System.Diagnostics.Process in my code.I hosted application in IIS where OS is Windows 7 when i try to play its not opening windows media player and not playing audio file.
I had seen suggestions in Internet where i need to give permission to IIS admin Service to interact with desktop applications but i hadn't seen any IIS admin Service in Services.msc.
Any one can suggest me

Instead of calling a desktop application, you can use javascript or the HTML audio tag.
There's a js library called Howler (https://github.com/goldfire/howler.js/), it makes easier to play audio from the browser.
In your gridview, you can have a column that has a button to play the audio, this button has an attribute that contains the audio path
Something like this:
<button data-audiosrc="pathtoaudio.mp3">Play audio</button>
Then you use this tag to call the howler to play the audio.
This is one approach.
Another one is to publish these files to an IIS web application and you can call it by the browser http://AudioIISApp/youraudio.mp3 (for example), will open another tab, so the user can listen or download.
This second is more easy and faster to implement!

Related

How to add photo to iPhone from desktop?

Recently, i want to create an application to sync photos between iphone and desktop by using C# language. I use Manzana library to copy image from PC to iphone.
As my understanding, the image file should be put under to /private/var/mobile/Media/PhotoData/Sync folder. But this does not work, i cannot see imported file when browse iphone photos although the file is copy to the location correctly.
Then i try to update the database file /private/var/mobile/Media/PhotoData/Photos.sqlite. To add a new entry to represent the imported photo file. Then i can see photo in iphone, but without thumbnails. And i have to restart the album application (close the application and start it again) so that to see the new imported photo.
But i found other tools can sync photo to iphone and can see the change immediately without restart the album application.
I want to know how this function is implemented?
Manzana is a C# wrapper of iTunesMobileDevice.dll. the main functionality is deal with iphone file system. and this is quite a old library which is not updated for a long time. I am not sure if there are any APIs to allow user to select an folder or photo file and sync it to iphone just like we do it in itunes, so that we don't need to process the db and thumbnails.
Does anyone have such experience before?
Im using desktop Dropbox as a buffer between mobile app and desktop.
Before this, you need a DropBox registered account and install the application.
After that, simple create a new folder from desktop Dropbox, drag-and-drop all
your photos into the new folder
Then, return to your iphone and retrieve them from DropBox mobile app.

Upload Files to Box from Linux Console using c# application

I have a c# desktop application developed using Mono which upload files to Box, In windows i am able to upload the files . The problem is that in windows there comes a Box login page and i manually giving the details and i got the code and token pair to upload file, but in Linux console mode i am not able to display the Box login page..
what should i do to Upload files to Box from Linux console.
i am using box-csharp-sdk-v2
You can forgo Box's APi entirely and hook something up to it via WebDAV, which is how it's traditionally done on console linux (well, that, and rsync). Since WebDAV is built on top of HTTP, it's cross platform as well. You'll need a C# friendly WebDAV client and all the settings/information to hook them up. Here's a quick link to a simple WebDAV client that should be easy enough to figure out:
WebDAVClient # Github
Point it at https://www.box.com/dav with your Box email and login, and voilĂ !
(Another, even simpler alternative is to set up DAVFS2 accordingly, making sure the drive is mounted, then handling it like any other directory. However, this requires outside setup and takes control out of the app's hands.)

Monotouch - playing video on network share

We are building an application that will only be used within our infrastructure. We have videos on a windows file share which we want to play within the app. The videos are working when they are embeded in the app but as some of them are so big we want to move them out.
I am trying to reference the videos using an smb:// url but that doesn't seem to work.
I am also trying to reference them using a file:// url to no avail. I can see the folder from the dev mac.
Should this work or do I need to do more work to make it happen? Such as streaming?
iOS is not able to access any kind of shared directory (smb:// or file://), you will have to add code to your app to connect and transfer the files yourself if you want to use a shared directory like that.
But iOS can access web servers, so if you can set up a simple http server (Apache or IIS), and serve the files using a http protocol, it should work just fine.

how can i play a video file in asp.net in c#?

I want to play a video file without any installed plugin for example. File extensions include .mov, .flv, .avi, or another. How can i play a video file but i won't user must be to install flash player and how can i play mp3 file in Asp.net in C#? I installed visual studio 2010 ultimate.
You have two options:
HTML5 video
<video src="movie.avi" controls>
<!-- The msg if browser doesn't have HTML5 video support -->
</video>
<object> for Windows Media player/QuickTime etc.
The first option will let you embed nicely the video, but will limit the user base(less than a half of browsers have HTML 5 support). Second option force the user to download the app.
This is what you want : Play video in asp.net using C#

How to browse the content of File in window phone 7?

I am new to the windows phone 7 development world. I am developing an application in window phone 7. In window mobile application (smart device application) we can browse the content of the mobile device by selecting the tools -> Device Emulator Manager -> slecting the emulator & then after clicking the cradle we can browse the content of the mobile device. I want to know how to do this in windows phone 7 application ? I also want to know how to programatically access the content of the Window Phone 7 ? (for e.g I want to open the screen which we will be opened after clicking the upload button in asp.net. In that screen we can navigate between the folder structure of the computer. In such way I want to open the screen for window phone 7) Because I am developing an application in which I want the images from the existing mobile device. So I want to browse the content of the mobile device so that I can select the particular image from the existing content of the mobile device & after that I will dynamically add these images to the images folder of my application. Can you please provide me any code or link through which I can resolve the above issue? If anyone know anything that will also help me a lot. Please share anything whatever anyone knows.
Due to the security model of Windows Phone 7 and fact that applications are sandboxed means that it is not possible to create a file system browser on the device. You can only see files / the directory structure within IsolatedStorage and you must create these files yourself.
You can, however, use MediaLibrary.Pictures or the PhotoChooserTask to access the images stored on the device. These are the images youu'll see in the Pictures hub and, therefore are outside of the files you specifically put in IsolatedStorage.
You can only access the files/directories that are located in the Isolated Storage that is assigned to your application, and you can get a list of those via GetDirectoryNames (for folders) and GetFileNames (for files). You will have to implement a custom listing mechanism since there is no default storage browser component.

Categories

Resources