Categories
Drupal Planet iPhone Development Talks

Drupal and Mobile Video – Dallas Drupal Camp 2013 – iPhone App and Presentation

Earlier this month, I spoke at the Dallas Drupal Camp about Drupal and mobile video. I’ve worked on a couple of projects for clients this year and last year that involved uploading and displaying videos from a mobile app on iOS and Android. Some of them have used Drupal for the server, others haven’t used Drupal at all. Mobile video can only be done through a native app (or PhoneGap), as HTML5 hasn’t provided support for uploading video through input types yet.

One of the obstacles to using Drupal as a video platform is getting everything set up – even though there are plenty of video modules, it can be tough to set up the Video module with Zencoder as a transcoding solution and Amazon S3 for storage and content distribution. Making this a lot easier if you are either starting from scratch or building out a proof of concept/minimum viable product is Octopus Video (http://octopusvideo.org/), a Drupal 7 distribution developed by Heidi Software and Symphony Themes. In effect, it’s a private YouTube distribution, which you can then extend using normal Drupal 7 modules and views to become a corporate training video archive, the back-end for a consumer-facing mobile app for cat videos, or whatever you want.

I gave a lightning talk about Octopus Video to the Austin Drupal User’s Group, and everyone there seemed pretty enthusiastic about the topic, so I decided to take it a step further and give a talk on it at the Dallas Drupal Camp this year.

In addition to sharing a lot of tips and tricks I learned from using Octopus Video as the server for a video-based mobile app prototype, I also created an open source iPhone app (Apache-style license) to show off some of the things you can easily do – upload video, display a list of videos from a Drupal video, and then play back videos stored on Amazon S3.

The GitHub repository for the open source iPhone app is here:

https://github.com/jefflinwood/DrupalMobileVideoAppIOS

This was a quick demonstration project for the Dallas Drupal camp, not extracted from a commercial project, so it’s missing a lot of the extras that would make it a polished app. I’ve added a few of them as issues to the GitHub project, and if I can find some more free time, I’d like to keep moving forward with it.

Categories
Android

Repeating Android Animations with AnimatorSet

The Android Honeycomb 3.0 (and newer) animation library has a nice little class called AnimatorSet (not to be confused with the older AnimationSet) that lets you organize animations either to be played together, or to be played sequentially. In this case, I needed to create an infinitely looping image fader that cycled through ImageView objects on the screen.

The ValueAnimator class has a nice setRepeatCount() method that would let me just set up my animation as running forever – but AnimatorSet extends Animator, not ValueAnimator, so you don’t get access to that. Setting the repeat to infinite for each Animator you put in the AnimationSet won’t work if you’re sequencing some animations (fade image 1, fade image 2, fade image 3, repeat), but it would work for two images if you set it to reverse itself.

Instead, the solution is to use an AnimatorListenerAdapter that listens for your animation set ending, and then starts the animation again. Make the animation a member of your fragment or activity, and then just put something similar to this in your listener:

[code lang=”java”]
mAnimationSet.addListener(new AnimatorListenerAdapter() {

@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mAnimationSet.start();
}

});
mAnimationSet.start();
[/code]