- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在 WebView 中加载 YouTube 视频。由于我的应用程序是在线广播应用程序,因此广播在后台播放。当我单击 webview 时,它会在 mpmovieplayer 中以全屏模式重定向视频。我想要的是当有人点击 webview 或 mpmovieplayer 开始播放视频时, radio 应该暂停。但是我如何跟踪 mpmoviepayer 何时开始播放和退出全屏幕。我还在我的 viewdidload
方法中设置了通知 MPMoviePlayerDidExitFullscreenNotification。但它从未被调用过。
self.videoTitleLabel.text = videoInfo.videoTitle;
//NSString *vidUrl = [videoInfo.videoURL stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
CGSize scrSize = [[UIScreen mainScreen] bounds].size;//appDel.window.frame.size;
float imgSclToX = scrSize.width/16.0;
int imgWidth = (int) (scrSize.width -18);
int imgHeight = (int) ((float)(9.0)*imgSclToX);
// DebugLog(@"Yo-----> Window: %@ Width: %i Height: %i", NSStringFromCGSize(scrSize), imgWidth, imgHeight);
NSString *htmlStr = @"";
// htmlStr = [htmlStr stringByAppendingFormat:@"<iframe width=\"%i\" height=\"%i\" src=\"%@\" frameborder=\"0\" allowfullscreen></iframe>", imgWidth, imgHeight, vidUrl];
NSString *tStr = videoInfo.videoURL;
// NSString *tStr = @"https://www.youtube.com/watch?v=yz_j7nVCJJ0";
tStr = [tStr substringFromIndex:([tStr rangeOfString:@"v="].location+2)];
htmlStr = [NSString stringWithFormat:@"<iframe type=\"application/x-shockwave-flash\" width=\"%i\" height=\"%i\" src=\"https://www.youtube.com/embed/%@\" frameborder=\"0\" allowfullscreen></iframe>", imgWidth, imgHeight, tStr];
NSString *embedHTML = [NSString stringWithFormat:@"<html><head></head><body>%@<p><b>Artist:</b> %@<br><b>Composer:</b>%@<p>%@</p></body></html>", htmlStr, videoInfo.videoArtist, videoInfo.videoCompositor, videoInfo.videoDescription];
[self.myWebview loadHTMLString: embedHTML baseURL: nil];
if([appDelegate.lastState isEqualToString:@"play"])
{
[appDelegate pausePlayer];
manuallyPause = YES;
}
最佳答案
查看答案 https://stackoverflow.com/a/26263803/1756448 (来自 user1717750)和 https://stackoverflow.com/a/26096400/1756448 (作者塞尔文)。
将 AVPlayerItemBecameCurrentNotification 与 iOS 8 的 UIWindowDidBecomeVisibleNotification 和 UIWindowDidBecomeHiddenNotification 结合使用而不是 UIMoviePlayerControllerDidExitFullscreenNotification。
对我有用! )
关于ios - mpmovie player dideexitfulscreen 通知在 ios 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25741643/
class Skeleton { public: void attack(Player player) { if (canAttackSkeleton()) {
我是使用 Java 播放音频的新手。我编写了代码来播放一些广播流。 我发现有一些流媒体网址,例如 http://fm939.wnyc.org/wnycfm .这没有端口号并包含斜杠。我只能使用 jav
我在我的 ReactPlayer 组件中使用 light={true} 设置在视频列表中显示缩略图。这在初始加载时工作正常。但是,当用户单击缩略图时,我会打开一个模式来播放视频(在单独的 ReactP
所以我目前正在为玩家重构游戏中的代码并启动一个玩家类: import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.b
某些应用程序和 IDE 建议安装 Adobe Flash 播放器的调试版本。我知道即使没有通过测试电影运行 Flash,这也允许查看跟踪语句,但还有什么不同呢?有什么事吗? 此外,我如何判断我看到
我已经阅读过类似的问题,但没有一个对我的情况有帮助。 这是我的 YouTube iframe: 我动态添加了 src 属性。 这是我的播放器: var player; function onYou
研究了许多主题和不同的领域后,我感到不知所措。我知道答案可能很简单,但我只是没有看到它。言归正传,这就是我正在做的事情。 我有一个本地托管的网页,当前如果在 Internet Explorer 中加载
Jwplayer 在正确加载视频之前闪烁“加载播放器时出错:无法加载播放器配置”一秒钟。我只是觉得这看起来不专业,我花了很多时间寻找如何抑制错误或隐藏它,直到视频加载完成。 在 Chrome 或 Sa
在 Exoplayer 版本中 2.14.1 Playerd.EventListener()已弃用。当我阅读文档时,它说使用而不是 Player.Listener ,但我不知道如何使用该方法,如下面的
我正在尝试创建一个按钮,允许用户单击它并停止嵌入的 YouTube 视频。但是,每当我尝试调用播放器对象本身来使用函数player.playVideo()时,我都会收到一条错误消息,指出该函数未定义。
我正在通过制作一个简单的纸牌游戏来学习数据结构。在这段代码中,我有一个类 Player 和一个包含游戏中所有玩家的 Queue。 队列的实现: template class Queue{
MPMoviePlayerController 播放器在按下完成按钮后永久隐藏播放器控件。 我有一个带有 moviePlayer.controlStyle = MPMovieControlStyleE
Player::Player(string Playername, int nr ,Board* x) { imie= Playername; number=nr; int k
情况是这样的。我在我的 Django REST API 上得到了一个列表:/playerslist/ 它返回了一个玩家列表,就像这个一样: http://pastebin.com/JYA39gHT 这
我有一个 YoutubePlayer 在我的 Motion Layout 中播放视频。我想实现这个youtube-like motion https://developer.android.com/t
我一直在使用 MPC-HC 窗口的状态文本来确定视频是正在播放还是暂停。但是,在全屏模式下或隐藏状态栏时,状态文本不会更新。有人向 MPC-HC 团队指出了这个错误,但尚未解决:https://tra
我的 Blackjack 默认构造函数中有这一行。 m_players[0].SetPlayerName("Jane"); 这在我的 Player 类中使用了一个 setter 来将玩家的名字设置为
我最近一直在开发 Ruby on Rails 应用程序。我们使用 Yahoo Web Player 来播放我们的音频和视频文件。它工作得非常好,特别是对于不允许使用 Flash 的平板电脑和智能手机。
更新:这个问题的前提被证明是被误导的。除非移动是响应用户单击,否则不会发生此问题。请参阅here . 这几天我一直在为一个错误而苦苦挣扎,希望有人能提供帮助。 我有一个 jquery 脚本,它使用 j
用图片说明更容易。抱歉审查。 在这个屏幕中有一个 WebView 是白色的部分,包含一个带有 Flash 内容的网页。 Flash 内容应该在底部红色条下方(部分隐藏在后面),因为 webview 边
我是一名优秀的程序员,十分优秀!