Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25801] : iOS SDK 7.0.2.GA - VideoPlayer playback issues #9890

Merged
merged 4 commits into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
});
});