Giter Site home page Giter Site logo

videoplayerkit's Introduction

VideoPlayerKit

We know how hard making a custom video player is. That's why we created VideoPlayerKit. Using VideoPlayerKit is easy to use. All controls, progress bar, and airplay are already set up to make everyone's life easier.

References to IGN's ShareThis repo and share button to handle sharing are currently commented out. More information can be found here.

Use the sample project to see how VideoPlayerKit works.

An example from IGN Pro League's deprecated "IPL" app (with ShareThis) are shown below:

Using the sample project

Download the github project and use the Makefile to gather all the pods require for VideoPlayerKit. Use the following command:

make clean setup

Note: If you get a build error due to architectural dependencies, update the following value in your Pods project's Build Settings for both Debug and Release modes:

Set Build Active Architectures Only —> “No”

Installation Instructions:

In the View Controller that will contain the video player:

Import VideoPlayerKit.h

import "VideoPlayerKit.h"

Initializing video player

[VideoPlayerKit initWithContainingViewController:optionalTopView:hideTopViewWithControls:];
[VideoPlayerKit initWithContainingView:optionalTopView:hideTopViewWithControls:];

Make sure that the view controller, or a specific inline view for inline players, containing the video player is passed into the first parameter. The optional top view is a view that will be at the top of the video player. This can be use to put any additional buttons or labels. The third parameter is a boolean that will be used to check if the top view should hide with the video player controls. If this is set to NO, it is still possible to hide the top view only on certain times given the situation using the two notifications: kVideoPlayerWillHideControlsNotification and kVideoPlayerWillShowControlsNotification.

Top View Edge Inset

setControlsEdgeInsets

If a top view is set, use this to offset the controls so it accounts for the top view. Usually you'll only want to change the edge inset's top parameter but the option is left open to change it entirely.

Playing the video

playVideoWithTitle:URL:videoID:isStreaming:playInFullScreen:

The method will automatically initialize the video player and start playing the video that is given in the url. The title parameter is used for the label that will appear near the top of the video player under the optional Top View. The videoID and isStreaming parameters are used mainly for analytics tracking. The last parameter, playInFullScreen, is a boolean that when set to YES, the video will play automatically in fullscreen without an inline player.

VideoPlayerDelegate

Event tracking

trackEvent:videoID:title:

This method is used for analytic event tracking. The first parameter will be one of three events: kTrackEventVideoStart, kTrackEventVideoLiveStart, kTrackEventVideoComplete. The videoID and title will be the same ones that was passed into the method playVideoWithTitle:URL:videoID:isStreaming:playInFullScreen:

Fullscreen toggle switch

BOOL fullScreenToggled

This property will be set to YES whenever the video player is fullscreen modally.

Optional Methods

Launch video player in fullscreen

launchFullScreen

Minimize video player from fullscreen

minimizeVideo

Play and pause video

playPauseHandler

Plays the video if paused. Pauses the video if playing.

Optional properties

Check if fullscreen mode is toggled

fullScreenModeToggled

Set the end time to static or dynamic

showStaticEndTime

Set this boolean to YES if the end time should just be a static label. Default setting is NO which will make the end time decrease as the video plays.

Get current video info

currentVideoInfo

A dictionary which uses these keys: @"title" for title of video, @"videoID" for id of video, @"isStreaming" to check if it is a live video.

Check if video is playing

isPlaying

Allow fullscreen view to be in portrait

allowPortraitFullscreen

Default fullscreen is landscape. For portrait fullscreen, mark this property to YES.

License

ShareThis is available under the MIT license. See the LICENSE file for more info.

videoplayerkit's People

Contributors

grantbartone avatar pellet avatar samuraizack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

videoplayerkit's Issues

IOS7. playpause button touch disable

hi.. i'm poor in english...

when i create app using this VideoPlayerKit in previous IOS7(ie. IOS5,IOS6...).

when i my app upgrade to IOS7. well. all control in good .. except play,pause button.

there is no touchevent occur in IOS7.

Undefined symbols for architecture arm64

I use xcode 6 build this prj and tell me that error
Undefined symbols for architecture arm64:
"_kTrackEventVideoComplete", referenced from:
-[VideoPlayerKit playerItemDidReachEnd:] in VideoPlayerKit.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

library not found for -lFacebook-iOS-SDK

i couldnt build . i got this error

ld: warning: directory not found for option '-F/Users/user1/Downloads/VideoPlayerKit-bf96edb50ad9c564591d491b9cc81483b7ea8035-2/VideoPlayerKitSampleProject/../../../Desktop/Cocoa_StreamStitcherDemo/StreamStitcherDemo'
ld: library not found for -lFacebook-iOS-SDK
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Typo in FullScreenView.m

self.autoresizesSubviews = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;

should be autoresizingMask

Optionally turn off Twitter and MessageUI dependencies

If I'm not going to use the sharing features features of VideoPlayerKit, I'd like an option to add it to my project with needing to include either of those frameworks. Maybe a linker flag could be used to communicate that the developer doesn't want to use sharing dependencies?

Demo project

Hi, are you going to do a demo project?

I'm trying to use the library but the avplayer fails to streaming all the m3u8 urls.

Thanks!

Storyboard support?

Is there any easy way to bring the player view into a Storyboard without having to recreate everything? I want to swap out some assets and generally clean things up a bit, and doing so programmatically is laborious.

Problem with pods.

Hi i make all steps installing pods but when i run my app i have this problem.

/Users/martingodec/Desktop/VideoPlayer/VideoPlayerKitSampleProject/Pods/Pods-resources.sh: line 5: /resources-to-copy-VideoPlayerSample.txt: Permission denied

How y solve this?

Inline player, IGN MainViewController

Hello,

First, this player looks great ! Exactly what I need.
I managed to make a project work with the player, with the github files.
On app main view I have blank view with the button to launch video, it works fine.

But I'm looking for some help / code / example to have the same view than the first snapshot : the inline / embedded player with video controls, and table view beneath.

Do you know where I could find some help, files or tips ? I made some tries, but can't get it done.

Hoping for answers,
Best regards.

How to show Thumbnail image of the video?

Hello VideoPlayerKit,

I am integrating this kit into my application. Now, i want to show the thumbnail image for the Videoplayer. How to show it into my player? Is there anyway to achieve this?

Xcode project fails to build from within generated workspace

Following the build instructions, I do make clean setup and this generates a VideoPlayerSample.xcworkspace

However building the VideoPlayerSample target results in the compile error:

/Users/.../VideoPlayerKit/VideoPlayerKitSampleProject/VideoPlayerSample/VideoPlayerSampleViewController.h:4:9: 'VideoPlayerKit.h' file not found

This would suggest to me that the workspace is not being setup correctly by the build script

Controls visibility

Great project BTW, thank you!

  1. Is there a way to prevent the controls from popping up even when user taps on the video?
  2. Is there a way to always hide the share button even when the controls are visible?

Volume

where the volume button

Link Error both in Sample Code and after implementation

Hey! First up, thanks for the awesome module.

Unfortunately, the sample project does not seem to build. It complains about a
'clang error: linker command failed with exit code 1 (use -v to see invocation)'.

It initially complains about there not being a VideoPlayerKit.h but I copy all the files from the folder 'Code' and paste them into the sample project.

Even when I add the code to my app, it fails to build with the same error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.