GithubHelp home page GithubHelp logo

dailymotion / dailymotion-swift-player-sdk-ios Goto Github PK

View Code? Open in Web Editor NEW
35.0 27.0 15.0 1.29 MB

Dailymotion Player SDK for iOS in Swift

License: MIT License

Ruby 0.80% Swift 43.36% Objective-C 54.19% C 1.64%
swift video dailymotion player dailymotion-player video-player swift-3

dailymotion-swift-player-sdk-ios's Introduction

Warning

We no longer support this SDK for Player integration on iOS environments. Please use the new iOS SDK documented here.

dailymotion-swift-player-sdk-ios's People

Contributors

azone avatar bitrise-dm avatar cmoissam avatar ekhoo avatar eren-celik avatar fdobjenschi avatar fdobjenschidm avatar florindob avatar jangorman avatar jdatour avatar kocoai avatar mccarthypaulmichael avatar morglr avatar remiguyon avatar romainbiard avatar sergeimikhan avatar vhosune avatar zouffin 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

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

dailymotion-swift-player-sdk-ios's Issues

Autoplay

How to make video dailymotion in native app swift autoplay?

Chromecast

there a way to get the content media item ? I want to implement the cast to a Chromecast using this lib, but I am not sure if I can get some media item to send to cast in the chromecast

Allow iOS to set full screen icon manually

Looking at the documentation for both iOS and Android, there is some inconsistency. On Android, they are allowed to set the full screen either true or false with

setFullScreenButton(Boolean)

But not on iOS. On iOS, it's only toggleFullscreen() which doesn't let you play with the boolean value at all.

Wondering if there is any work around?

start parameter is not working

I have done a sample project with the below parameters and it's working correctly. After a month I tried the same parameters is not working and the video still starts from 0

let parameters: [String: Any] = [
"fullscreen-action": "trigger_event",
"logo": "false",
"sharing-action": "trigger_event",
"start": Int(25)
]
let controller = DMPlayerViewController(parameters: parameters)
controller.delegate = self
return controller
}()

Autoplay problem in iOS < 11.4

When i start play video in iOS >= 11.4 it's play fine.
When i start play video in iOS 11.2 and 10.3 it's didn't start play.
For test i use demo app.

override func viewDidLoad() {
    super.viewDidLoad()
    setupPlayerViewController()
    playerViewController.load(videoId: "x4r5udv", params: "{ \"autoplay\": true }")
}

or

 fileprivate lazy var playerViewController: DMPlayerViewController = {
    let parameters: [String: Any] = [
      "fullscreen-action": "trigger_event",
      "sharing-action": "trigger_event",
      "autoplay": true
    ]
    let controller = DMPlayerViewController(parameters: parameters)
    controller.delegate = self
    return controller
  }()

Example project | No user interaction

I just download your example project. I am able to load video but there is no user interaction. I try to click on pause / fullscreen / share, nothing happens.

I'm facing the same problem in my project using your POD !

Since I can't click on buttons, they disappear, when I try to show them again (by many clicks), this is what happen :

capture d ecran 2017-01-25 a 11 32 00

The view is broken.

Fullscreen problem

Hi team,

How do I trigger fullscreen with default player of iOS system? Then the default player control of iOS system will appear instead of Dailymotion player control.

Thanks.

[!] Unable to find a specification for `DailymotionPlayerSDK`

Hi..

when, i' am pod install, appear error [!] Unable to find a specification for DailymotionPlayerSDK.

this full my pod file

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'DailyMotion' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'DailymotionPlayerSDK'

  target 'DailyMotionTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'DailyMotionUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

volume change

can't get volume change event in the demo

  func player(_ player: DMPlayerViewController, didReceiveEvent event: PlayerEvent) {
    switch event {

case .namedEvent(let name, let data) where name == "volumechange":
			print(data);

    default:
      break
    }
  }

player does not play video

#6 the exemple if you move the load from the play function in the setupPlayerViewController the video does not load, I get a black view.

This can reproduce the way I am handling in my app. #

How to create custom view on video player

I am making video player in swift. I add some custom buttons and functionality for standard video player: 1. Playing video from URL (server) 2. Showing indicator while loading video like in VK 3. Add custom buttons to control (stop, pause buttons) and its working fine. I'm trying to implement custom view on player like below screen shot and play in custom duration in loop.

I need this type of view on video player

Screen Shot
1

I can't understand how I can implement my tasks(For video url) there. Can you give some advice, which is the better way to do this?

Fullscreen button

Is possible to hide/show fullscreen button by another button or event?

How to use Daily Motion player with Swift UI properly

Hi all,

I been working in a project where we have to use Daily Motion player in a iOS and Android app. I'll focus only in iOS here.

The app is targeted to iOS 14.5 and it use SwiftUI to compose user interface.

I'm getting several problems to handle Daily Motion player using SwiftUI, specially to manage when and how to stop or continue playing a video.

I did a sample project here. That project can be used to explore some of these issues.

First one is related to initializer.
There are some params like autoplay that never work. The video always start playing, even if I try to force it to stop after load callback.

Second is related to lifecycle.
There's no way to stop playing after a view disappear or another view been presented over another. Even using dismantleUIViewController from UIViewControllerRepresentable, the player doesn't respond to playback commands and sometimes, its reference is lost.

I kept this sample simple as possible to ask you help to figure out what I have to do to make it more functional for SwiftUI apps.

Thanks

How to set Extra Parameters in swift

I want to add set parameters like android:
setExtraParameters("ui-logo=false&ui-start-screen-info=false&sharing-enable=false&endscreen-enable=false");

Video can not play again if be paused when view controller disappears

Hi, Guys
I add these code in ViewController.swift of your Demo Project

override func viewDidDisappear(_ animated: Bool) {
    super.viewDidDisappear(animated)
    playerViewController.pause()
}
    
override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    playerViewController.play()
}

And stay in ViewController2.swift for 5 seconds, then come back, the video can not play again,
except seek duration time or reload.

Do you know what happened?

qualitiesavailable event does not properly work

Hello
I have an issue with the "qualitiesavailable" event. Every time I am using it, the only quality returned is 144P. I think it may be the preroll's quality. But, when the media starts, the "qualitiesavailable" is not called.

Is there a proper way to get the available qualities for a video and change the quality, without using the Dailymotion controls ? (I think the only way to do this is to reload the video, using the "start" and "quality" playerParameters)

Thanks;
Best regards,
Alexis

Cannot dismiss once I have entered Fullscreen.

After entering Fullscreen, dragging down stops the videos, instead of resizing it.
app

Code
  let parameters:[String:Any] = ["controls": 1]  
  let playerView = DMPlayerViewController(parameters: parameters)  
  addChildViewController(playerView)  
  playerView.view.frame = tableHeader.bounds  
  playerView.delegate = self  
  playerView.load(videoId: movie.VId!)  
  playerView.play()

Feature request: ads playback state

I implement native controls for dailymotion video player. I've faced difficulties with ads. There is no flags for checking if ads are playing. Can you implement this? I know there are ads events and I can implement this on my side, but it will be useful for other sdk users.

Video paused but not the button

Here is the scenario:

1/ Launch a viewController having a Dailymotion player and an audio player.
2/ Start the Dailymotion player
3/ Start the audio player
-> The Dailymotion video is paused but sometimes the play button is not changed and still have pause image in place of play.

Video player fills entire screen

I used all the codes, but ended with a video that loads, but the player is the entire screen. Adjusting the view size doesn't change anything. Here is the screenshot
screen shot 2017-01-18 at 6 15 21 pm

How to exit FullScreen?

I'm using DMPlayerViewController in full screenmode and start it via a present command, so modal.
All's good, but how do I close now this full screen modal ?

The little full screen icon doesn't do anything, no event sent in the delegate, there is no X button or anything, so, how do I close it ?

Android has a hardware back, we don't. Any other idea except me adding a X button in code in your controller?

Bug with the player control buttons

When we select the settings of the player and after we close it, we loose the control of the player and we can't have the control buttons anymore.

If connected with Headphone then video pause

Hello,

I am integrating it with Swift 3.2 and am facing a strange issue. When I connect the headphone then it will stop to playing the video or sometime video is playing but no sound come in headphone. When I disconnect the headphone then it will remain in pause state.

Any suggestion?

Duration is not available for Live DVR videos

For live videos with DVR, the duration is not available. On iOS we only receive the event with infinite duration:
"event=durationchange&duration=Infinity"

At the same time on Android we receive seekable duration with concrete value for the same video, like this:
"event=durationchange&duration=1000.12"

We have tested with different videos and have the same problem for all of them.
It used to be ok last week.

Thanks.

Multiple player instance in UICollectionView with rejected_inactive_tab error

I would like to have multiple video instance in a horizontal UICollectionView which keep the last playing state, something like the Home screen in dailymotion iOS app downloadable from App store. User should be able to continue from the previous fetch video.

How can we do this? I don't see any sample from the sample code

What have been done:
I have tried to put DMPlayerViewController view as a view in the collection view cell.
Whenever the list is populated,
playerViewController?.load(videoId: videoId, params: "{ \"autoplay\": false }", completion: nil) will be triggered for each cells.

Whenever the screen is loaded with the collection view cells, these are the logs produced with
Code:

public func player(_ player: DMPlayerViewController, didReceiveEvent event: PlayerEvent) {
        logger.log(message: "Player event \(event)", LoggingOption: .debug)
        switch event {
        case .timeEvent(name: let name, time: let time):
            logger.log(message: "Player event timeEvent \(name) time \(time)", LoggingOption: .debug)
        case .namedEvent(name: let name, data: let data):
            logger.log(message: "Player event namedEvent \(name) data \(data)", LoggingOption: .debug)
        case .errorEvent(error: let error):
            logger.log(message: "Player event errorEvent \(error)", LoggingOption: .debug)
        }
   }

Result:

📖
XXDailyMotionPlayer.player(_:didReceiveEvent:) 
Player event namedEvent(name: "scalemodechange", data: Optional(["scaleMode": "fit"]))

📖
XXDailyMotionPlayer.player(_:didReceiveEvent:) 
Player event namedEvent scalemodechange data Optional(["scaleMode": "fit"])
📖
XXDailyMotionPlayer.playerDidInitialize(_:)
playerDidInitialize <DailymotionPlayerSDK.DMPlayerViewController: 0x13679d3f0>
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "apiready", data: nil)
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:) 
Player event namedEvent apiready data nil
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "volumechange", data: Optional(["volume": "1"]))
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent volumechange data Optional(["volume": "1"])
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event timeEvent(name: "videochange", time: 87.0)
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event timeEvent videochange time 87.0
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:) 
Player event namedEvent(name: "playback_ready", data: nil)
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent playback_ready data nil
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:) 
Player event namedEvent(name: "playback_ready", data: nil)
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent playback_ready data nil
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:) 
Player event namedEvent(name: "subtitlesavailable", data: Optional(["subtitles[]": "en"]))
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:) 
Player event namedEvent subtitlesavailable data Optional(["subtitles[]": "en"])
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "subtitlechange", data: Optional(["subtitle": "-1"]))
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:) 
Player event namedEvent subtitlechange data Optional(["subtitle": "-1"])

I have a custom play pause button which will trigger
dmPlayerViewController.play() or dmPlayerViewController.pause()

Whenever I tapped on the play button, I always saw this error in the logs:
Player event namedEvent(name: "playback_resolution", data: Optional(["status": "rejected", "reason": "rejected_inactive_tab"]))
What could be the reason for this error?

In the documentation, embed multiple players only appears for web.
How can we do this for iOS?

Thanks

There is an issue with two videos playing simultaneously

When you navigate to the next video, the previous video continues to play in the background. The player stop method has already been called in the viewwilldisappear method. The player is still playing a video in the background.

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.