Playing movie files without the URL in Visual Basic 2010 - vb.net

Right now in my project I have the windows media player object, and I can get that to play movies on it by inputting the movie URL into the URL property. How do I get it to play a movie that is currently in my resources? Because when I transfer the executable file to my other laptop to test it it doesn't work.
Thanks.

If i remember correctly, when you embed a video file into the application you only embed the data of it, and the extension gets stripped.
So in order to view it, you would need to copy it to a temporary directory and add the extension yourself, then play it from that location.
I haven't found a need to do such a thing since 2005, so visual studio may have made some changes.
Easiest way would be to have the video file you want played stored in the same location as your programs executable and simply refer to it using its name.

Related

creating a file upload function with titanium

I'm supposed to develop a mobile app for moodle using android on titanium studio. And I have been searching for days for any helpful article on how to get a file chooser dialog to work on android. Most of the tutes offer image upload but I need to upload .pdf and zip files from mobile. I have already tried fileChooserDialog() and folderChooseDialog() to no avail. Help please?
There isn't a file chooser out of the box, as apps usually send files to each other internally. You can roll your own using ListViews though easily..
Build a list of all the files you're interested in. (https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Filesystem.File-method-getDirectoryListing)
Loop through the list omitting any file types you don't want and build the list
When the user selects a file capture the click event and upload that file.
Style however you want..

how do i add background music to auto play in the background of my vb project

I have a project in vb 2010 that im working on. I want to know if i publish this and make it downloadable when it is done will my background music be heard by others?
Im pretty sure it's only playing on mine because the song is on my computer right?
Is there a code to make it so it stays even if i make this program downloadable?
You need to have the background music distributed with the program. It should be possible to include the music file as a resource in your project, and then to pass that resource to what you use to play the audio.
Alternatively, you could simply package the music file with your executable (whether you're using a zip or an installer), and then find the file in the same directory as your application, and play it that way.

PowerPoint Programmatically open/play mediaobject in add-in

I am working on a VSTO PowerPoint 2010 add-in which will allow the user to playback a media object (video or audio) in a windows form using windows media player control.
In which way can I extract the embedded media object an play it back to the user?
I have access to the objects name, will that be enough to get to the embedded object?
Kinda yes and no.
The "No". Through VBA and VSTO, the answer is no or at least I've never seen it done before and have no idea. I've looked at this before and didn't find it to be possible.
The "Kinda Yes". Any embedded media in 2007/2010 can be extracted through Open XML. Here's where the "kinda" comes in - you can extract it so long as you know what you're extracting. Sounds easy enough, but it's not. When you insert a video or audio piece, it gets embedded into a shape. That shape is given a name[1], which is the file name of the audio/video file. So if I insert the sample video that comes with Win7, my shape name that holds the video is "wildlife.wmv". It can easily be renamed by an end user who knows how to do so (the Selection Pane in the client) and in that case, it would be impossible to find based on just having the name.
But if it hasn't been renamed, you would open an in-memory copy of your .pptx in Open XML, search on the name in each of the slides in the /ppt/slides/ folder and once found, use it's relationship Id to locate it's name in the /ppt/media folder. Then you can pull it out, save it to disk, play it, etc.
1 PowerPoint, however, renames the file based on an internal naming convention. My "wildlife.wmv" is renamed "media1.wmv" inside the package. Subsequent media items would be named media2.wmv, media1.mpg, etc.

Are Objective-C function names stored in text?

I don't remember where I heard about it, (I think I was searching up on how selectors worked and it ended up not being exactly the same as a callback function) and I can't confirm it. But more importantly than that, is there a way I could get a list of the function names from another application?
See class-dump.
You can sometimes see a list of the method names in an application. Find the .ipa file for the app (possibly in the Music->iTunes->Mobile Applications directory on a Mac). Make a copy of one of the ipa files and change it from .ipa to .zip. Unzip the file and in the Payload folder, there's a file with the same name as the app. Right click on it and "Show Package Contents". In there, you'll find another file with the same name as the app (with no extension). This is the executable file for the app. If you open it in a text editor like BBEdit, you'll sometimes be able to see some method names, as well as a list of the frameworks the app is built against. You can find the path name where things were kept too, often with the developer's name.
For example, looking into the Japanese dicitonary Daijirin, I can see these methods:
-[HMWebSupport openMONOKAKIDOSupportWithSafariForView:style:]
-[HistoryViewController viewWillAppear:]
I can also see that one of the developers was called Norihito, and he was using SVN: /Users/norihito/Developer/SVN/Mobile/DAIJIRIN/Other
Other applications (like Weightbot) don't show as much information. I don't know the reason it shows up some times and doesn't other times.

Using Office 2007 extension (i.e. docx) for skin based On-Screen keyboard

I'm creating a On-Screen keyboard for my application, and it supports skins as well.
Here's what I'm doing with the skins, I have a folder which contains some images and a xml file which maps the images to the keyboard, I want to be able to have the folder as a zip file like in Office 2007 (.docx) and iPhone firmwares (.ipsw), I know I can simply zip the folder and change the extension, what I need to know is how to read the files in the code.
You've got two options, either 1) just use a zip library like SharpZipLib or DotNetZip or 2) try to use the System.IO.Packaging namespace. I think option 1 would be the easiest probably.
There's nothing really magical that Office and other programs are doing, they're just reading a zip file and pulling stuff out of it as needed. Instead of pulling an image from a disk you just pull it from a MemoryStream.