Skip to main content

Posts

How to jump to time offsets in HTML5 video

Let's say that you have a 30-minute WEBM video file, from which you just want to play the following video segments , jumping from one to the other automatically  without interruptions : [00:01:25.00 - 00:02:25.00] -> from second 85 to 145 [00:11:40.00 - 00:11:55.00] -> from second 700 to 715 [00:20:26.00 - 00:21:07.00] -> from second 1226 to 1267 [00:26:11.00 - 00:28:01.00] -> from second 1571 to 1681 To increase the complexity, let's think that you have these video segments in a PHP variable $arrayVideoSegments  (normally the case if they were retrieved from the database).   $arrayVideoSegments[0]->startTime = 85   $arrayVideoSegments[0]->endTime = 145   $arrayVideoSegments[1]->startTime = 700   $arrayVideoSegments[1]->endTime = 715   $arrayVideoSegments[2]->startTime = 1226   $arrayVideoSegments[2]->endTime = 1267   $arrayVideoSegments[3]->startTime = 1571   $arrayVid...

How to install a SSL certificate in Tomcat 8

If you want to run your web app on Tomcat 8 (Linux) under the HTTPS umbrella, these are the steps that you need to follow. In this example we will use test domain example.com : 1) Purchase an SSL certificate from trusted provider. Price ranges from $5 to over $100 per year. 2)  SSH to your Linux server and, from your personal directory /home/ youruser / type the following command in order to generate the private key : keytool -genkey -alias tomcat -keyalg RSA -keystore example .keystore 3)  You will be asked some questions. The most important ones are the keystore password (let's assume it is yourPassword ) and the First and last names , which is actually misleading because you need to enter the domain name: example.com . 4) Generate your local Certificated Signing Request (CSR) with this command: keytool -certreq -keyalg RSA -alias tomcat -file example .csr -keystore example .keystore 5) Open the CSR file that you have just generated with  ...

What I learnt validating my MVP and promoting my app for free

In October 2015 I developed Xtegos - Voices for Whatsapp as a weekend project. Xtegos is a mobile app to r ead messages with funny foreign accents and share them on Whatsapp as voice messages. After launching the MVP for  Android , I wanted to test the following assumptions : 1) People like sharing voice messages with someone else's voice on Whatsapp groups. 2) People prefer that voice to have a funny foreign accent. 3) This app will grow organically after some initial marketing effort. In order to achieve some customer base, I implemented the following marketing strategies : A) Create a website , Facebook page and a Twitter account  (renamed one with 5k followers). B) Share the app with my personal contacts on social media. C) Share funny voice messages created with Xtegos on my Whatsapp groups. D) Promote Xtegos on Facebook groups with keyword "Whatsapp" with a big lie in the post: " Xtegos, the app to share voices on Whatsapp th...

How to share remote audio files on social media using Phonegap

I wanted to create the iOS and Windows Phone versions of Xtegos using Phonegap , and the main problem I had was sharing audio files on Whatsapp. There is a fantastic Cordova plugin called Social Sharing , developed by Eddy Verbruggen (thanks for your help), which makes things much easier, but it does not explain how to share audio files. This is how I did it on Javascript: The function below assumes that your file is in a remote server. If this is not the case, the code is much simpler and you can remove all the XMLHttpRequest code. function shareAudio() {   var endpoint = 'http://www.example.com/yourFile.mp3;   var client = new XMLHttpRequest();   client.open('GET', endpoint, true); // Async call    // Need to change the MimeType for this kind of binary content   client.overrideMimeType("text/plain; charset=x-user-defined");   client.onreadystatechange = function() {      // When the progress is level 4 (ready) and the ...

Xtegos: funny accents for your Whatsapp voice messages

It's a fact, we can't help smiling when someone orders a drink in Spanish with a very strong English accent, the same way English people smile when I ask for directions with my Spanish accent.  However, we really appreciate their effort speaking a foreign language. I wanted to know how would people react if they had an app to recreate these international accents and share them with their friends. That is why  I spent 8.5h developing Xtegos , an Android app that enables users to read any text with nine different accents and share the result  as a voice message  on Whatsapp . The interface is extremely simple, literally a text box, nine voice selectors, a button to listen and another one to share on Whatsapp. In the backend I am using Android TTS after trying out some other free text-to-speech APIs. The best thing about this native voice synthesizer is that you can use it even offline . The voices currently available are: English, French, German, Brazilian, It...

How to fix the "cryptswap1 is not ready yet" error on Ubuntu?

I never paid attention to the error message that, every time I started Ubuntu 14.04, was saying that " The disk drive for /dev/mapper/cryptswap1 is not ready yet or not present ". However, this caused that today I couldn't start the system at all, which is a painful and stressful experience. These are the steps I followed to fix the issue and get Ubuntu back to life. 1)  At the GRUB menu , start Ubuntu in recovery mode 2) At the Recovery menu , select " Drop to root shell prompt " 3) Type " sudo swapoff -a " to disable swapping 4) Type " sudo mount -o remount,rw " to have write access to the system files 5) Type " sudo nano -w /etc/crypttab " and put a "#" at the beginning of the line that starts with " cryptswap1 ". Save the file. 6)   Type " sudo nano -w /etc/fstab " and put a " # " at the beginning of the line that starts with " /dev/mapper/cryptswap1 ". Save the ...

Using Windows and you can't see your Android device on DDMS? This is how to fix it!

I recently bought a new phone running on Android 5.0.2 and, after enabling the Developer Mode and activating USB debugging , I was unable to connect it to Eclipse on Windows 10. The DDMS view and adb devices command showed an empty list. This is how I fixed it: 1) Make sure you the Google USB Driver installed in your Android SDK folder. 2)  Connect your device via USB and open Control Panel -> Device Manager . 3)  You will see under " Other devices " an unrecognized " ADB Interface ". Right-click on it and select " Update Driver Software ". 4)  Click on " Browse my computer " and enter the path to your Google USB Driver ( <sdk>\extras\google\usb_driver\ ). 5)  Click on " Let me pick from a list of device drivers " and select " Android USB Device ". 6) Save changes and restart your IDE. Your device should be now visible from your DDMS view.