Skip to content

Commit

Permalink
[TIMOB-25801] : iOS SDK 7.0.2.GA - VideoPlayer playback issues (#9890)
Browse files Browse the repository at this point in the history
* [TIMOB-25801] : iOS SDK 7.0.2.GA - VideoPlayer playback issues

* [TIMOB-25801] : Unit test case added
  • Loading branch information
vijaysingh-axway authored and hansemannn committed May 21, 2018
1 parent 4b79a82 commit 280086a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iphone/Classes/TiMediaVideoPlayerProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ - (void)handlePlaybackStateChangeNotification:(NSNotification *)note
playing = ([[movie player] rate] == 1.0);
if (playing) {
_playbackState = TiVideoPlayerPlaybackStatePlaying;
} else if (movie.player.currentItem.duration.value == movie.player.currentItem.currentTime.value || !movie.player.currentItem.canStepBackward) {
} else if (movie.player.currentItem.currentTime.value == 0 || !movie.player.currentItem.canStepBackward) {
_playbackState = TiVideoPlayerPlaybackStateStopped;
} else {
_playbackState = TiVideoPlayerPlaybackStatePaused;
Expand All @@ -957,7 +957,7 @@ - (void)handleTimeControlStatusNotification:(NSNotification *)note
if (movie.player.timeControlStatus == AVPlayerTimeControlStatusPlaying) {
_playbackState = TiVideoPlayerPlaybackStatePlaying;
} else if (movie.player.timeControlStatus == AVPlayerTimeControlStatusPaused) {
if (movie.player.currentItem.duration.value == movie.player.currentItem.currentTime.value) {
if (movie.player.currentItem.currentTime.value == 0) {
_playbackState = TiVideoPlayerPlaybackStateStopped;
} else {
_playbackState = TiVideoPlayerPlaybackStatePaused;
Expand Down
18 changes: 18 additions & 0 deletions tests/Resources/ti.media.videoplayer.addontest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Appcelerator Titanium Mobile
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/* eslint-env mocha */
/* global Ti */
/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions');

describe('Titanium.Media.VideoPlayer', function () {
it.ios('playbackState', function () {
var player = Ti.Media.createVideoPlayer();
should(player).have.readOnlyProperty('playbackState').which.is.a.Number;
});
});

0 comments on commit 280086a

Please sign in to comment.