Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from kosso/master
Browse files Browse the repository at this point in the history
Added ability to set albumArtwork via URL fo locksceen info
  • Loading branch information
dieskim committed Feb 23, 2015
2 parents 9e3a3c0 + 6730c72 commit e1687bc
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 160 deletions.
14 changes: 14 additions & 0 deletions Classes/NetHoyohoyoTiremotecontrolModule.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,26 @@ -(void)setNowPlayingInfo:(id)args
NSString *title = [TiUtils stringValue:@"title" properties:args def:@""];
NSString *albumTitle = [TiUtils stringValue:@"albumTitle" properties:args def:@""];

NSString *albumArtwork = [TiUtils stringValue:@"albumArtwork" properties:args def:nil];

Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");

if (playingInfoCenter) {

NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init];

if(albumArtwork != nil){

UIImage *artworkImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:albumArtwork]]];

MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage:artworkImage];
[songInfo setObject:albumArt forKey:MPMediaItemPropertyArtwork];
}

[songInfo setObject:artist forKey:MPMediaItemPropertyArtist];
[songInfo setObject:title forKey:MPMediaItemPropertyTitle];
[songInfo setObject:albumTitle forKey:MPMediaItemPropertyAlbumTitle];

[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo];
}
}
Expand Down
151 changes: 0 additions & 151 deletions README

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This module makes your titanium applications to extend AV-related functions of i
- You can handle events of earphone's remote-control. (play, pause, nextTrack and so on.)
- You can show some information of playing track to a locked screen and etc.

- Update : Added albumArtwork (using URL) to lockscreen info. (@Kosso)

How to Use
----
Expand All @@ -16,7 +17,8 @@ var Control = require('net.hoyohoyo.tiremotecontrol');
Control.setNowPlayingInfo({
artist: 'someone',
title: 'Happy Birthday to You',
albumTitle: 'unknown'
albumTitle: 'unknown',
albumArtwork : 'http://an.image.url'
});

Control.addEventListener('remotecontrol', function(e) {
Expand Down
12 changes: 6 additions & 6 deletions manifest
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 0.1
version: 0.1.1
apiversion: 2
description: My module
author: Your Name
license: Specify your license
copyright: Copyright (c) 2013 by Your Company
description: TiRemoteControl
author: hoyo (+kosso)
license: MIT
copyright: Copyright (c) 2015


# these should not be edited
name: TiRemoteControl
moduleid: net.hoyohoyo.tiremotecontrol
guid: 9326b7d7-f454-4b2d-bd81-1aebcd8ee868
platform: iphone
minsdk: 3.0.2.GA
minsdk: 3.5.0.Beta
Binary file added net.hoyohoyo.tiremotecontrol-iphone-0.1.1.zip
Binary file not shown.
Binary file removed net.hoyohoyo.tiremotecontrol-iphone-0.1.zip
Binary file not shown.
6 changes: 4 additions & 2 deletions titanium.xcconfig
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR
//
//
TITANIUM_SDK_VERSION = 3.0.2.GA

// Change this to whatever your latest SDK is...
TITANIUM_SDK_VERSION = 3.5.0.Beta


//
// THESE SHOULD BE OK GENERALLY AS-IS
//
TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
TITANIUM_SDK = /Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include"
TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore"
HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2)
Expand Down

0 comments on commit e1687bc

Please sign in to comment.