Skip to Content
詳解 iOS SDK 第4版 ―ワンランク上のiPhone/iPadプログラミング
book

詳解 iOS SDK 第4版 ―ワンランク上のiPhone/iPadプログラミング

by Matt Neuburg, 武舎 広幸, 阿部 和也, 河村 政雄, 上西 昌弘, 福地 太郎
December 2014
Intermediate to advanced
752 pages
13h 22m
Japanese
O'Reilly Japan, Inc.
Content preview from 詳解 iOS SDK 第4版 ―ワンランク上のiPhone/iPadプログラミング

15章ビデオ

単純なビデオ再生には、Media Playerフレームワークが提供するビューを利用します。このフレームワークを使うには、ソースに@import MediaPlayerと記述します。関連するクラスは次のふたつです。

  • MPMoviePlayerController——ムービーを再生するビューを提供します。このビューには、ユーザーが再生を制御するためのコントロールが含まれています。
  • MPMoviePlayerViewController——UIViewControllerのサブクラスで、MPMoviePlayerControllerを所有し、そのビューを表示します。

また、ビデオをトリミングするためのシンプルなインタフェース(UIVideoEditorController)も用意されています。

高度なビデオ再生や編集には、AV Foundationを使用できます。この章の最後で、AV Foundationを取り上げ、ムービーやオーディオの再生が可能なもうひとつのクラスであるAVPlayerについて説明し、AV Foundationのビデオ編集やオーディオ編集機能も紹介します。

MPMoviePlayerViewControllerやAVPlayerで音声を出力する場合は、アプリのオーディオセッションにも注意が必要になるかもしれません。詳しくは14章を参照してください。ただし、どちらのクラスも、アプリがバックグラウンドに移る際に再生を一時停止し、フォラグラウンドに戻る際には再生を再開するといった動作はうまく処理してくれます。

ムービーファイルは、.movや.mp4などの標準的な形式はもちろん、音声ファイルでもかまいません。したがって、MPMoviePlayerViewControllerやMPMoviePlayerViewControllerは、簡単に音声ファイルを再生する方法としても利用できます。この音声ファイルには、インターネットからリアルタイムで取得したファイルも含まれます。さらに、14章でUIが利用できないと指摘したAVAudioPlayerとは異なり、一時停止や再生ヘッドの移動などが可能な、標準的なコントロールも提供されます。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

入門 iOS SDK ―初めてのiPhone/iPadプログラミング

入門 iOS SDK ―初めてのiPhone/iPadプログラミング

Matt Neuburg, 武舎 広幸, 阿部 和也, 河村 政雄
実践 Android Developer Tools

実践 Android Developer Tools

Mike Wolfson, 長尾 高弘

Publisher Resources

ISBN: 9784873116754Other