You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by 杨恒 <ya...@yonyou.com> on 2015/11/10 09:51:58 UTC
ask for helping play video on ios8+
Hi,sorry to trobule you,but I has a urgent problem when I play local video on ios8+.
the development is cordova@5.3.1 and the version of ios simulator is 8.4.
now I want to play local a video using html tag "video" after download and unzip ,but the result is just a gray play button and can't play.
I had converted to cdvfile:// and tried to use native path,both are the same.
and the code here
cordovaFileTransfer.download(uri,targetSource)
.then(function(entry){
var desDIr=self.filePath+'/'+self[type]+'/'+o._id;
scope.core.textLabel="解压中。。。";
scope.core.progress="";
cordovaZip.unzip(targetSource,desDIr).then(function(data){
resolveLocalFileSystemURL(desDIr+'/running.mp4', function(entry) {
var nativeUrl=entry.toInternalURL();
o.videoUrl= nativeUrl;
o.coverUrl=desDIr+'/cover.png';
if(type=='star'){
o.courseUrl= desDIr+'/course.json';
o.coverUrl=desDIr+'/control.json'
}
d.resolve(o);
});
},function(err){
console.log(JSON.stringify(err));
d.reject(err);
})
},function(err){
console.log(JSON.stringify(err));
d.reject(err);
},function(notify){
scope.core.textLabel="下载中";
scope.core.progress=Math.round((notify.loaded / notify.total) * 100)+"%";
})
the video code here
<video controls="controls" width="400px" height="250px" preload="auto" webkit-playsinline="true">
<source src="{{config.src}}" type="video/mp4" />
</video>
and also add
<access origin=''cdvfile://*"/> to config.xml
So can you help me ...waiting for you
杨恒
Re: ask for helping play video on ios8+
Posted by Raymond Camden <ra...@gmail.com>.
This mailing list is not for general support questions, but rather the
development of Cordova itself. Please see the PhoneGap Google group or
StackOverflow.
On Tue, Nov 10, 2015 at 2:51 AM, 杨恒 <ya...@yonyou.com> wrote:
>
> Hi,sorry to trobule you,but I has a urgent problem when I play local video on ios8+.
> the development is cordova@5.3.1 and the version of ios simulator is 8.4.
> now I want to play local a video using html tag "video" after download and unzip ,but the result is just a gray play button and can't play.
> I had converted to cdvfile:// and tried to use native path,both are the same.
> and the code here
>
> cordovaFileTransfer.download(uri,targetSource)
> .then(function(entry){
> var desDIr=self.filePath+'/'+self[type]+'/'+o._id;
> scope.core.textLabel="解压中。。。";
> scope.core.progress="";
> cordovaZip.unzip(targetSource,desDIr).then(function(data){
> resolveLocalFileSystemURL(desDIr+'/running.mp4', function(entry) {
> var nativeUrl=entry.toInternalURL();
> o.videoUrl= nativeUrl;
> o.coverUrl=desDIr+'/cover.png';
> if(type=='star'){
> o.courseUrl= desDIr+'/course.json';
> o.coverUrl=desDIr+'/control.json'
> }
> d.resolve(o);
> });
> },function(err){
> console.log(JSON.stringify(err));
> d.reject(err);
> })
> },function(err){
> console.log(JSON.stringify(err));
> d.reject(err);
> },function(notify){
> scope.core.textLabel="下载中";
> scope.core.progress=Math.round((notify.loaded / notify.total) * 100)+"%";
> })
>
>
> the video code here
> <video controls="controls" width="400px" height="250px" preload="auto" webkit-playsinline="true">
> <source src="{{config.src}}" type="video/mp4" />
> </video>
>
> and also add
> <access origin=''cdvfile://*"/> to config.xml
>
>
> So can you help me ...waiting for you
>
> 杨恒
--
===========================================================================
Raymond Camden, Developer Advocate for MobileFirst at IBM
Email : raymondcamden@gmail.com
Blog : www.raymondcamden.com
Twitter: raymondcamden
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org