Hi,
i have update my fuse studio from 1.9.0 to 1.10 and cameraview is not working. is it an android tools version problem or what? Did someone have a solution for it.
here is the code:
<WhileActive>
<JavaScript>
var Context = require("Modules/Context");
var Observable = require("FuseJS/Observable");
var Camera = _cameraView1;
var state = false;
Camera.setCaptureMode(Camera.CAPTURE_MODE_VIDEO)
.then(function(newCaptureMode) {
})
.catch(function(error) {
});
Camera.setCameraFacing(Camera.CAMERA_FACING_FRONT)
.then(function(newCameraFacing) {
})
.catch(function(error) {
});
var cameraBack = true;
function flipCameraFacing() {
var front = Camera.CAMERA_FACING_FRONT;
var back = Camera.CAMERA_FACING_BACK;
Camera.setCameraFacing(cameraBack ? front : back)
.then(function (newFacing) {
cameraBack = newFacing == back;
})
.catch(function (err) {
});
}
var numContact=this.Parameter.map(function(param){return param.numero});
var nomContact=this.Parameter.map(function(param){return param.noms});
nomContact.subscribe(module);
var ss = Observable("00");
var mm = Observable("00");
var hh = Observable("00");
var date=new Date();
var timeReceive=date.getTime();
function goBack() {
Context.addAppel(timeReceive, ""+hh.value+":"+mm.value+":"+ss.value, numContact.value , "Sortant", "video", nomContact.value)
if(typeof timerID != 'undefined')
clearInterval(timerID);
state = false;
var secondes=0;
ss.value="00";
var minutes=0;
mm.value="00";
var heures=0;
hh.value="00";
Camera=null;
router.goBack();
}
function startTimer(){
state = true;
var secondes=0;
ss.value="00";
var minutes=0;
mm.value="00";
var heures=0;
hh.value="00";
timerID = setInterval(function(){
secondes+=1;
if(secondes<10)
ss.value="0"+secondes;
else
ss.value=secondes;
if(secondes>59){
minutes+=1;
secondes=0;
ss.value="00";
if(minutes<10)
mm.value="0"+minutes;
else
mm.value=minutes;
}
if(minutes>59){
heures+=1;
minutes=0;
mm.value="00";
if(heures<10)
hh.value="0"+heures;
else
hh.value=heures;
}
}, 1000);
}
//startTimer();
module.exports = {
goBack,
ss,
mm,
hh,
flipCameraFacing,
};
</JavaScript>
</WhileActive>
<DockPanel Dock="Fill" Width="100%" Height="100%" Margin="0, 0, 0, 0" Background="#8712d0">
<Rectangle Color="#EF6A6A" Width="100%" Height="60" Alignment="Top" Margin="0, 0, 0, 0" Dock="Top">
<StackPanel Alignment="Center">
<Text TextColor="#fff" Font="textFontBold" Value="{nomContact}" FontSize="20" TextAlignment="Center" Alignment="Top" />
<WhileTrue Value="{state}">
<Text Font="textFont" FontSize="15" Value="Durée : {hh}:{mm}:{ss}" TextColor="#fff" Alignment="Center" Margin="0, 0, 0, 0" TextAlignment="Center" />
</WhileTrue>
<WhileFalse Value="{state}">
<Text Font="textFontBold" FontSize="15" Value="Connexion..." TextColor="#fff" Alignment="Center" Margin="0, 0, 0, 0" TextAlignment="Center" />
</WhileFalse>
</StackPanel>
</Rectangle>
<Rectangle Dock="Top" Width="100%" Height="150" Alignment="Bottom" Layer="Overlay">
<DockPanel Width="85%">
<Circle Dock="Left" Alignment="CenterLeft" Color="#848484" Width="60" Height="60">
<Image File="../Assets/Block Microphone_96px.png" Color="#000" Width="35" Height="35" />
</Circle>
<Circle Dock="Fill" Alignment="Center" Color="#F61212" Width="80" Height="80" Clicked="{goBack}">
<Image File="../Assets/End Call_96px.png" Color="#fff" Width="50" Height="50" Alignment="Center" />
</Circle>
<Circle Dock="Right" Color="#848484" Width="60" Clicked="{flipCameraFacing}">
<Image Width="35" Height="35" File="../Assets/Switch Camera_96px.png" Color="#000" />
</Circle>
<StackPanel Dock="Top" Orientation="Horizontal" Margin="0, 0, 0, 0" ItemSpacing="10" Alignment="CenterLeft" Visibility="Hidden">
<Image File="../Assets/Add User Group Man Man_96px.png" Color="#8712d0" Width="30" />
<Text Value="Joindre un ami" Font="textFont" TextColor="#8712d0" Margin="0, 5, 0, 0" />
</StackPanel>
</DockPanel>
</Rectangle>
<NativeViewHost Width="100%" Height="50%" Dock="Bottom" Padding="0, 0, 0, 0" Margin="0, 0, 0, 0" Alignment="BottomRight">
<CameraView Alignment="BottomRight" ux:Name="_cameraView1" Width="100%" Height="100%" Margin="0, 0, 0, 0" Dock="Bottom" />
</NativeViewHost>
</DockPanel>
</DockPanel>