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

fix(ios): amend TiMediaVideoPlayer parent controller #13011

Merged
merged 3 commits into from
Sep 2, 2021

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Aug 10, 2021

JIRA:
https://jira.appcelerator.org/browse/TIMOB-28518

Summary:


Framed Video Test:

  1. Build and run the below on iOS.
  2. Verify a small video is shown within a blue frame.
  3. Tap on the video and select the "fullscreen" button.
  4. Verify the video is now shown fullscreen.
const window = Ti.UI.createWindow();
const videoView = Ti.Media.createVideoPlayer({
	url: "https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/tests/remote/mov_bbb.mp4",
	autoplay: true,
	borderWidth: "4dp",
	borderColor: "blue",
	width: "300dp",
	height: "200dp",
});
window.add(videoView);
window.open();

NavigationWindow Test:

  1. Build and run the below on iOS.
  2. Tap on the "Play Video" button.
  3. Verify a child window slides in and shows a video.
  4. Tap on the video and select the "fullscreen" button.
  5. Verify the video is now shown fullscreen and you can't see the top navigation bar anymore.
let navigationWindow = null;
const parentWindow = Ti.UI.createWindow({
	title: "Parent Window",
	backgroundColor: OS_IOS ? "white" : "?android:attr/colorBackground",
});
const openButton = Ti.UI.createButton({ title: "Play Video" });
openButton.addEventListener("click", () => {
	const childWindow = Ti.UI.createWindow({ backgroundColor: "black" });
	childWindow.add(Ti.Media.createVideoPlayer({
		url: "https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/tests/remote/mov_bbb.mp4",
		autoplay: true,
		width: Ti.UI.FILL,
		height: Ti.UI.FILL,
	}));
	navigationWindow.openWindow(childWindow, { animated: true });
});
parentWindow.add(openButton);
navigationWindow = Ti.UI.createNavigationWindow({
	window: parentWindow,
});
navigationWindow.open();

TabGroup Test:

  1. Build and run the below on iOS.
  2. Verify 1st tab shows a small video view within a blue border.
  3. Tap on the video and verify it plays.
  4. Tap on the video and select the fullscreen option.
  5. Tap on the video and exit fullscreen mode.
  6. Select tab 2 and repeat steps 2-5.
function createTab(title, icon, videoUrl) {
	const window = Ti.UI.createWindow({ title: title });
	window.add(Ti.Media.createVideoPlayer({
		url: videoUrl,
		autoplay: false,
		borderWidth: "4dp",
		borderColor: "blue",
		width: "300dp",
		height: "200dp",
	}));
	const tab = Ti.UI.createTab({
		title: title,
		icon: icon,
		window: window,
	});
	return tab;
}

const tabGroup = Ti.UI.createTabGroup({
	tabs: [
		createTab("Tab 1", "/assets/images/tab1.png", "https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/tests/remote/mov_bbb.mp4"),
		createTab("Tab 2", "/assets/images/tab2.png", "https://github.com/appcelerator/kitchensink-v2/raw/master/app/assets/videos/example-video.mp4"),
	],
});
tabGroup.open();

@garymathews garymathews added this to the 10.1.0 milestone Aug 10, 2021
@build build requested a review from a team August 10, 2021 19:20
@build
Copy link
Contributor

build commented Aug 10, 2021

Fails
🚫 Tests have failed, see below for more information.
Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 1 tests have failed There are 1 tests failing and 960 skipped out of 15528 total tests.
📖 👍 Hey!, You deleted more code than you added. That's awesome!

Tests:

ClassnameNameTimeError
test.handleBuildworks2.309
Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-13011/build/lib/test/test-test.js)

Generated by 🚫 dangerJS against e244779

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR: Failed

When showing the video player not-fullscreen, the video is wrongly displayed in the window's top-left corner instead.

You can reproduce the issue with the below. The video should be played within a 300x200 view in the center of the window (it has a blue border), but the video is wrongly shown in the top-left corner.

const window = Ti.UI.createWindow();
const videoView = Ti.Media.createVideoPlayer({
	url: "https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/tests/remote/mov_bbb.mp4",
	autoplay: true,
	borderWidth: "4dp",
	borderColor: "blue",
	width: "300dp",
	height: "200dp",
});
window.add(videoView);
window.open();

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR/FR: Pass

Copy link
Collaborator

@ewanharris ewanharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR Pass. Original behaviour is restored, tests cases and sample from ticket all now function as expected.

@ewanharris ewanharris merged commit eb319ef into tidev:master Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants