Prevent skipping video on Azure Media Player - azure-media-player

How can we prevent skipping the video on Azure Media Player? I have tried many tricks to do it but got failed every time.
Below are the events which I have tried:
amp.eventName.seeking
amp.eventName.play
amp.eventName.playing
amp.eventName.pause
amp.eventName.ended
amp.eventName.timeupdate
In which there is no option to prevent skipping the video.

Related

Youtube Embedded Player: Prevent video from appearing in User's Watch History

I am writing a webapp that integrates with Youtube and plays Videos using the Youtube Embedded Player.
One feature I'm trying to implement involves preventing a Video that is being watched from being added to the User's Watch History. That way they can watch songs related to movies/tv shows/video games without getting assaulted with potentially spoiler containing videos the next time they log into Youtube.
I have been unable to prevent it by sandboxing the iframe the player is in.
It also looks like removing entries from the Watch History has been deprecated as of August 2016 with the Data API.
Is there any way to prevent Youtube from tracking the video being watched?
Thanks!

Video No Longer Recording Audio (PBJVision/AVFoundation)

I have an app (enterprise, distributed OTA) that among other things records video clips. All of a sudden, we started getting video uploads that were missing audio, and this issue now seems to be totally reproducible. I've been using the PBJVision library, which had seemed to work great, but I have also tested this with SwiftyCam (another AVFoundation-based library) with same results. It's unclear exactly when this was introduced, but I've checked the following:
Ensure that a NSMicrophoneUsageDescription is set in the target .plist
Ensure that camera and microphone permissions are showing as granted in system settings
Try disabling microphone permissions in settings (app correctly prompts the user to re-enable permissions)
Try earlier releases of the video capture library in case of regression
Try different video capture library
Explicitly set audio enabled and bitrate for PBJVision/SwiftyCamera, and ensure that the session is at least reporting that it has audio in the logs (that is, the library and AVFoundation think there's an input set up, with an input stream that's being handled)
Take a video with the system camera, and upload through the app — in this case, audio does work (it's not a problem with the hardware)
Reset all content and permissions on a device, to make sure there isn't some kind of cached permission hanging out
Make sure volume is not muted
The copy that gets saved to the camera roll is also silent, so it's not happening when the video gets uploaded. I also started to implement recording using just AVFoundation, but don't want to waste time if that will produce the same results. What could be causing a particular app not to record audio with video? I have looked at related questions, and none of the solutions provided address the problem I'm having here.
EDIT:
Here are the logs that appear when starting, recording, and stopping a PBJVision session:
[5411:1305718] VISION: camera setup
[5411:1305718] VISION: switchDevice 1 switchMode 1
[5411:1305718] VISION: capture session setup
[5411:1305291] VISION: session was started
[5411:1305718] VISION: capture session running
[5411:1305291] VISION: starting video capture
[5411:1305718] VISION: ready for video (1)
[5411:1305718] VISION: audio stream setup, channels (1) sampleRate (44100.000000)
[5411:1305718] VISION: ready for audio (1)
[5411:1305291] VISION: ending video capture
[5411:1305963] VISION: capture session stopped
[5411:1305963] VISION: session was stopped
[5411:1305291] CMTimeMakeWithSeconds(8.396 seconds, timescale 24): warning: error of -0.021 introduced due to very low timescale
It turns out that this was actually due to using another library to play a sound after starting the video recording. This apparently preempts the audio channel for the recording, as that ends up being empty (see Record Audio/Video with AVCaptureSession and Playback Audio simultaneously?). It does not appear to matter whether or not the other sound playback is started before or after starting video recording. This is a good warning case around using multiple libraries that all touch the same system APIs — in some cases, like this one, they interact in undesirable ways.
In this case, the solution is to make sure that the two sources aren't using the same AVAudioSessionCategory, so they don't conflict.

youtube live recording timestamp

I'm working on an YTL api project and I'm been successful in starting and stopping the live streaming form a PHP application but I need to extend the project to a VOD functionality where I need to know the exact timestamp when the recorded video begun. Any hint on how to retrieve the initial timestamp of a recorded event?

AVPlayer seekToTime download an insane amount of media segment files consuming a lot of data

I'm working in an app where I'm able to play a HLS m3u8 playlist of a streaming radio (audio only) without any problem using an instance of AVPlayer. Using Charles I can see how the playlist is updated properly in a normal pace (each 9-10 seconds, which takes one media segment file). When I perform a seekToTime: (back in time), the player success playing the stream from when I want to, but in Charles I observe how the player starts dowloading a huge amount of media segment files, consuming a lot of data. It seems that the player downloads all the media segment files until that time and then keeps again with the normal behaviour.
I understand that the correct behaviour would be to download the media segment file for the time I'm seeking to, start playing it and then download constantly 1 or 2 media segment files each 9-10 seconds, as it does when I play the stream without timeshift.
My question is if this is a normal behaviour, or if something could be wrong with my m3u8 playlist or the client implementation. Anyone could help me to clarify this?
UPDATED: I can confirm this doesn't happen in iOS 7, so it seems to be a bug introduced by iOS 8.
I've been told by Apple that this is not a bug, but a feature. They've made the buffer bigger since iOS 8.

AVPlayer and client transparent origin switching

I'm developing iOS app which uses HLS. In our video platform we use Nginx proxy_pass module for redirecting from one origin to another when one of them becomes unavailable (at all we have 2 origins). Switching between origins is transparent for client, it's maintained by balancer, for client playlist URI stays unchanged.
We faced a problem with AVPlayer with such switching workflow wich also appear in QuickTime.
According to network log next things happens:
At the moment of switching AVPlayer asks for live playlist again and when it finishes playing chunks loaded before switching it starts to play not the next chunk in playlist but the first!
And there no change in AVPlayer currentTime property, it continues to change like there was no switching on the first chunk (in normal seeking at the start of playlist currentTime will be 0), no player item status changes happen, no notifications are thrown, nothing special in access log, error log is empty at all.
So we can't update user interface (i.e. seek bar) and alter user that he was redirected to another time of live streeam. And the problem is even worse in context that we should not show user the live stream out of bounds of particular broadcast.
Any suggestions how to solve this? Or it's core AVPlayer bug (as far as this issue also appear in Quicktime)?
The solution was:
1) to use different names for playlist on different origins,
2) send back to client 404 or another error when trying to update playlist from disabled origin,
3) use fallback in playlists - add second, alternative playlist from second origin in multibitrait playlist. It's stated in HLS documentation. When AVPlayer recieve error while updating playlist it tryes to update from fallback playlist
4) to provide manual quality selection, we had also to wrap playilists for particular qualities in intermediate variant playlists with master playlist and fallback playlist. FMS which we use for generating playlists from livestream can't do that, so we needed to generate variant playlist on side of Nginx
The result is fault-tolerant video platform with transparent switching between master and slave (second) origins which works with auto and manual quality selection.

Resources