File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -544,28 +544,38 @@ var connectsdk = (function () {
544
544
}
545
545
} else if ( commandType === 'getPosition' )
546
546
{
547
+ var currentTime = 0 ;
548
+
549
+ if ( mediaElement && mediaElement . currentTime )
550
+ currentTime = mediaElement . currentTime ;
551
+
547
552
this . _send ( {
548
553
type : 'p2p' ,
549
554
to : from ,
550
555
payload : {
551
556
contentType : 'connectsdk.mediaCommandResponse' ,
552
557
mediaCommandResponse : {
553
558
type : commandType ,
554
- position : mediaElement . currentTime ,
559
+ position : currentTime ,
555
560
requestId :requestId
556
561
}
557
562
}
558
563
} ) ;
559
564
} else if ( commandType === 'getDuration' )
560
565
{
566
+ var duration = 0 ;
567
+
568
+ if ( mediaElement && mediaElement . duration )
569
+ duration = mediaElement . duration ;
570
+
561
571
this . _send ( {
562
572
type : 'p2p' ,
563
573
to : from ,
564
574
payload : {
565
575
contentType : 'connectsdk.mediaCommandResponse' ,
566
576
mediaCommandResponse : {
567
577
type : commandType ,
568
- duration : mediaElement . duration ,
578
+ duration : duration ,
569
579
requestId :requestId
570
580
}
571
581
}
You can’t perform that action at this time.
0 commit comments