-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducce cordova based ios platform
- Loading branch information
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"requires": ["html5"], | ||
"templates": ["*.html", "config.xml"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Object { | ||
property bool macAccessable: false; | ||
property bool supportingUhd; | ||
property bool supporting3d; | ||
property string modelName; | ||
property string firmware; | ||
property string sdk; | ||
|
||
getDeviceId(callback): { log("Not implemented") } | ||
getMacAddress(callback): { log("Not implemented") } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Item { | ||
signal error; | ||
signal finished; | ||
property string source; | ||
property Color backgroundColor: "#000"; | ||
property float volume: 1.0; | ||
property bool loop: false; | ||
property bool ready: false; | ||
property bool muted: false; | ||
property bool paused: false; | ||
property bool autoPlay: false; | ||
property bool waiting: false; | ||
property bool seeking: false; | ||
property int duration; | ||
property int progress; | ||
property int buffered; | ||
|
||
LocalStorage { id: volumeStorage; name: "volume"; } | ||
|
||
play: { } | ||
stop: { } | ||
pause: { } | ||
seek(value): { } | ||
seekTo(value): { } | ||
|
||
volumeUp: { this.volume += 0.1 } | ||
volumeDown: { this.volume -= 0.1 } | ||
toggleMute: { this.element.dom.muted = !this.element.dom.muted } | ||
onVolumeChanged: { this.applyVolume() } | ||
|
||
applyVolume: { | ||
if (this.volume > 1.0) | ||
this.volume = 1.0; | ||
else if (this.volume < 0.0) | ||
this.volume = 0.0; | ||
|
||
volumeStorage.value = this.volume | ||
this.element.dom.volume = this.volume | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python2.7 | ||
|
||
import argparse | ||
import os | ||
|
||
|
||
def build(app, title): | ||
os.system('rm -rf %s' %app) | ||
res = os.system('cordova create %s com.example.app %s' %(app,title)) | ||
if res != 0: | ||
print "Failed to create ios app" | ||
return | ||
os.system('cp -r `ls -A | grep -v "%s"` %s/www' %(app,app)) | ||
os.system('cp androidIcon.png %s' %(app)) | ||
os.system('cp config.xml %s' %(app)) | ||
os.chdir(app) | ||
os.system('cordova platform add ios') | ||
os.system('cordova build ios') | ||
os.chdir('..') | ||
|
||
|
||
parser = argparse.ArgumentParser('qmlcore build tool') | ||
parser.add_argument('--app', '-a', help='application name', default="app") | ||
parser.add_argument('--title', '-t', help='application title', default="App") | ||
args = parser.parse_args() | ||
|
||
|
||
res = os.system('cordova --version') | ||
if res == 0: | ||
build(args.app, args.title) | ||
else: | ||
print 'Install "cordova" first: https://cordova.apache.org/docs/en/latest/guide/cli/' |